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.
The first two pie charts from the left is currently how my pie chart and slicer works:
The third pie chart (desired outcome) is what I want to achieve.
When I select a filter, I want the pie chart to show the filtered pie slice's percentage and number out of the total population.
How do I achieve this?
Solved! Go to Solution.
Hi @msuser48
Thanks for reaching out to us.
Here are 2 solutions.
(1) solution 1 --> create a legend table,
relationship
create a measure
Measure 2 =
var _sel=SELECTEDVALUE(slicer[Parameter])
var _count_total=COUNTX(ALL('Table'),[Name])
var _count_sel=COUNTX(FILTER(ALL('Table'),'Table'[Parameter]=_sel),[Name])
return IF(ISFILTERED(slicer[Parameter]),IF(MIN('legend'[Parameter])="Other",_count_total-_count_sel,IF(MIN('legend'[Parameter])=_sel,COUNTX('Table',[Name]))),COUNTX('Table',[Name]))
result
(2) solution 2 --> if you add one row in your table,
then, create a table below used in slicer
then create a measure and put it into pie chart
Measure =
var _sel=SELECTEDVALUE(slicer[Parameter])
var _count_total=COUNTX(ALL('Table'),[Name])
var _count_sel=COUNTX(FILTER(ALL('Table'),'Table'[Parameter]=_sel),[Name])
return IF(ISFILTERED(slicer[Parameter]),IF(MIN('Table'[Parameter])="Other",_count_total-_count_sel,IF(MIN('Table'[Parameter])=_sel,COUNTX('Table',[Name]))),COUNTX('Table',[Name]))
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @msuser48
Thanks for reaching out to us.
Here are 2 solutions.
(1) solution 1 --> create a legend table,
relationship
create a measure
Measure 2 =
var _sel=SELECTEDVALUE(slicer[Parameter])
var _count_total=COUNTX(ALL('Table'),[Name])
var _count_sel=COUNTX(FILTER(ALL('Table'),'Table'[Parameter]=_sel),[Name])
return IF(ISFILTERED(slicer[Parameter]),IF(MIN('legend'[Parameter])="Other",_count_total-_count_sel,IF(MIN('legend'[Parameter])=_sel,COUNTX('Table',[Name]))),COUNTX('Table',[Name]))
result
(2) solution 2 --> if you add one row in your table,
then, create a table below used in slicer
then create a measure and put it into pie chart
Measure =
var _sel=SELECTEDVALUE(slicer[Parameter])
var _count_total=COUNTX(ALL('Table'),[Name])
var _count_sel=COUNTX(FILTER(ALL('Table'),'Table'[Parameter]=_sel),[Name])
return IF(ISFILTERED(slicer[Parameter]),IF(MIN('Table'[Parameter])="Other",_count_total-_count_sel,IF(MIN('Table'[Parameter])=_sel,COUNTX('Table',[Name]))),COUNTX('Table',[Name]))
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@msuser48 , a Little bit of modeling is needed. Please find the attached file after the signature. Check there are two pies, one with the measure is what you need
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 |
---|---|
106 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
139 | |
104 | |
104 | |
80 | |
66 |