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 have a line graph which shows the number of people by age and in the legend a separate grouping for these people. How can I display the percentage of people within that group for each age?
E.g. Within the whole of group 1, x % of these people are age 'Y' etc
Thanks!
afk
Hi @bo_afk ,
You can create the following measure:
% = DIVIDE(COUNTROWS('Table'), CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Group])))
Then add it to tooltips , then you can view the % in tooltips:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@amitchandak , @v-deddai1-msft , thanks for you suggestions!
I also have an age slicer filter on the page so that I can see the numbers for a particular age range with the "total" value for this range only. But when I apply the filter, the formula doesn't recalculate accordingly and the "total" value is excluding the filter that I applied.
Do I need to change the formula to allow slicer filters?
Hi @bo_afk ,
Please use the following measure to contains filter from page:
% = DIVIDE (
COUNTROWS ( 'Table' ),
CALCULATE ( COUNTROWS ( 'Table' ), ALLSELECTED ( 'Table'[age] ) )
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @v-deddai1-msft , I gave this a go but for some reason, it's showing close to 0% or 100% for most of the ages.
@bo_afk , Try a measure like
divide([measure], calculate([measure],allexcept(Table[group])))
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 |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |