Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I made a stacked bar chart to show gender data over a period of years, I was able to show the percent with this measure:
Gender % = DIVIDE(DISTINCTCOUNT('Table1'[PIDM]),CALCULATE(DISTINCTCOUNT('Table1'[PIDM]),ALLEXCEPT('Table1','Table1'[Year])))
Now the problem I have is that when I add a slicer (lets use state as example) when I click on one of the options the percent show is not within what is filtered.
Example: No slicer shows for 2014 61% Male and 39% Female click on Oregon state slicer and it shows 22% Male and 33% Female which clearly does not add 100%
What I'm doing wrong?
Solved! Go to Solution.
You may refer to the post below.
https://community.powerbi.com/t5/Desktop/Percentages-to-multi-line-report/m-p/378504#M172040
You may refer to the post below.
https://community.powerbi.com/t5/Desktop/Percentages-to-multi-line-report/m-p/378504#M172040
Probably something to do with the allexcept function you're using, I'm guessing that your numerator will count just Oregon in 2014, but the denominator will count every state in 2014, i.e. it'll show in your data 22% of 2014 is male in Oregon, because you're telling it to ignore every filter context except the year. Seems an unnecessarily complex formula to be honest
So... any sugestions?
I'd rewrite the formula, but without seeing your data model or data it's hard to do so, so just add whatever column you're feeding into the state filter into the allexcept bit of the existing measure
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |