Forum Discussion

KMcCarthy9's avatar
KMcCarthy9
Helper V
5 years ago
Solved

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! 

  • 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))

     

3 Replies

  • 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))