Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 46 | |
| 42 | |
| 26 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |