Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KMcCarthy9
Helper IV
Helper IV

DAX Filters Not Working

I have the following calculation, yet it does not seem to be doing what I want it to and I'm not sure why. I want the count of "Future" but only for ones that have a target start date later than the current month, but still for this year. It currently gives me the total count instead of applying the filters I want.

 

Future Count = CALCULATE(COUNTA('SAMACO PM'[PM_OnTime]), 'SAMACO PM'[PM_OnTime] in {"Future"}, MONTH('SAMACO PM'[Target Start Date] > MONTH(NOW())),YEAR('SAMACO PM'[Target Start Date] = YEAR(NOW())))

 

What changes are needed to my calc?

 

Thank you! 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@KMcCarthy9 , hope there is no other filter that stopping that

if so use all

Future Count = CALCULATE(COUNTA('SAMACO PM'[PM_OnTime]), filter(all('SAMACO PM'), 'SAMACO PM'[PM_OnTime] in {"Future"}, 'SAMACO PM'[Target Start Date] > eomonth(today(),-1)))

 

else try without all

 

Future Count = CALCULATE(COUNTA('SAMACO PM'[PM_OnTime]), 'SAMACO PM'[PM_OnTime] in {"Future"},'SAMACO PM'[Target Start Date] > eomonth(today(),-1))

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@KMcCarthy9 , hope there is no other filter that stopping that

if so use all

Future Count = CALCULATE(COUNTA('SAMACO PM'[PM_OnTime]), filter(all('SAMACO PM'), 'SAMACO PM'[PM_OnTime] in {"Future"}, 'SAMACO PM'[Target Start Date] > eomonth(today(),-1)))

 

else try without all

 

Future Count = CALCULATE(COUNTA('SAMACO PM'[PM_OnTime]), 'SAMACO PM'[PM_OnTime] in {"Future"},'SAMACO PM'[Target Start Date] > eomonth(today(),-1))

 

@amitchandak  I had to change the -1 to a 0 at the end, but both worked after that. 

 

Thank you! 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.