Forum Discussion
Use Filters in Measure DAX
- 6 years ago
I would first try your original measure with ALLSELECTED() instead of ALL().
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years ago
Hi DHB ,
You may try to use the below measure:
DIVIDE(COUNT(ACTIVITY[PERSON_CODE]),CALCULATE(COUNT(ACTIVITY[PERSON_CODE]),ALLSELECTED(ACTIVITY)))Please try.
Aiolos Zhao
Thanks Pat, that works but I have another issue now. I'm representing that measure in a gauge visual and when I apply filters in the report the value stays at 100%. With the DAX I used before it only showed 60% but when I used filters this would go up and down between 0-60. Can I use the ALLSELECTED version and still have the gauge correspond to the filters I use somehow?
DHB , try like
DIVIDE(calculate([COUNT(ACTIVITY[PERSON_CODE]),FILTER(ACTIVITY,ACTIVITY[YEAR]=2019&(ACTIVITY[ENROL_WF]="active"))),CALCULATE(COUNT(ACTIVITY[PERSON_CODE]),ALL(ACTIVITY)))