Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
How can ALLSELECTED work when I filter a value included in one of the measures required to calculate the percentage?
Number of Visits
# Visits = CALCULATE(SUM(Main[VALUE]),ALL(Main[OrderCode]), FILTER(ALLSELECTED(Main),Main[OrderCode]= 1))
Number of Incomplete Visits
# Visits Incomplete = CALCULATE(SUM(Main[VALUE]), ALL(Main[OrderCode]), FILTER(ALLSELECTED(Main),Main[OrderCode]= 2))
Measure
Measure = IF(MIN(Main[OrderCode]) = 3 , [# Visits Incomplete]/[# Visits], BLANK())
Thank you
When modifying two measures as below, I can calculate the percentage.
# Visits = CALCULATE(SUM(Main[VALUE]),FILTER(ALL(Main),Main[OrderCode]= 1))
# Visits Incomplete = CALCULATE(SUM(Main[VALUE]), FILTER(ALL(Main),Main[OrderCode]= 2))
Best Regards
Maggie
Using ALL would aggregate the numbers in the roll up level. You can't see that in the sample above, but if you add dates (which is what I have in my real report), you'll be able to see the issue. Is there another option?
Could you show me some example dataset which will effect the result you want for better analysis?
Best Regards
Maggie
User | Count |
---|---|
59 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
39 |