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
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
- DHB6 years agoHelper V
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?
- Anonymous6 years agoNot applicable
Hi DHB ,
You need to tell us what's your expected result finally. Because the allselected function is to calculate % by person code.
Please show us the sample data(what you want) and show us what you want(screenshot or image).
It's better to give some examples for different scenarios.
Aiolos Zhao
- DHB6 years agoHelper V
This page in my report is filtered to 2019 and active users (1102 in total). My original DAX didn't filter out other years or user states so gave me a % of 60.9 in the gauge. the new DAX gives me the right % but it doesn't change when I move the slider on the left.
- amitchandak6 years agoSuper User
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)))