Forum Discussion
Summarize data from multiple tables in ONE pie chart
- Anonymous3 years ago
Hi msuser48 ,
As far as I know ,Power BI currently only support us to show number + percentage of total in Pie. If you show three values in three tables in pie, the percentge by default will show by logic (number/ all numbers from three tables).
Here I suggest you to show percentge in each table by tooltip.
My Sample:
Legend = {"table1","table2","table3"}Measure:
Count in each table = SWITCH ( MAX ( Legend[Value] ), "table1", CALCULATE ( COUNT ( table1[Review status] ) ), "table2", CALCULATE ( COUNT ( table2[Review status] ) ), "table3", CALCULATE ( COUNT ( table3[Review status] ) ) )Percentage in each table = VAR _COUNT1 = CALCULATE ( COUNT ( table1[Review status] ) ) VAR _TOTAL1 = CALCULATE ( COUNT ( table1[Review status] ), ALL ( table1 ) ) VAR _COUNT2 = CALCULATE ( COUNT ( table2[Review status] ) ) VAR _TOTAL2 = CALCULATE ( COUNT ( table2[Review status] ), ALL ( table2 ) ) VAR _COUNT3 = CALCULATE ( COUNT ( table3[Review status] ) ) VAR _TOTAL3 = CALCULATE ( COUNT ( table3[Review status] ), ALL ( table2 ) ) RETURN SWITCH ( MAX ( Legend[Value] ), "table1", DIVIDE ( _COUNT1, _TOTAL1 ), "table2", DIVIDE ( _COUNT2, _TOTAL2 ), "table3", DIVIDE ( _COUNT3, _TOTAL3 ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi msuser48 ,
As far as I know ,Power BI currently only support us to show number + percentage of total in Pie. If you show three values in three tables in pie, the percentge by default will show by logic (number/ all numbers from three tables).
Here I suggest you to show percentge in each table by tooltip.
My Sample:
Legend =
{"table1","table2","table3"}
Measure:
Count in each table =
SWITCH (
MAX ( Legend[Value] ),
"table1", CALCULATE ( COUNT ( table1[Review status] ) ),
"table2", CALCULATE ( COUNT ( table2[Review status] ) ),
"table3", CALCULATE ( COUNT ( table3[Review status] ) )
)Percentage in each table =
VAR _COUNT1 =
CALCULATE ( COUNT ( table1[Review status] ) )
VAR _TOTAL1 =
CALCULATE ( COUNT ( table1[Review status] ), ALL ( table1 ) )
VAR _COUNT2 =
CALCULATE ( COUNT ( table2[Review status] ) )
VAR _TOTAL2 =
CALCULATE ( COUNT ( table2[Review status] ), ALL ( table2 ) )
VAR _COUNT3 =
CALCULATE ( COUNT ( table3[Review status] ) )
VAR _TOTAL3 =
CALCULATE ( COUNT ( table3[Review status] ), ALL ( table2 ) )
RETURN
SWITCH (
MAX ( Legend[Value] ),
"table1", DIVIDE ( _COUNT1, _TOTAL1 ),
"table2", DIVIDE ( _COUNT2, _TOTAL2 ),
"table3", DIVIDE ( _COUNT3, _TOTAL3 )
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AnonymousI managed to get most of this to work, however it does not show as percentage of the individual table here:
It shows as "1,00" no matter which filter is applied. It should show as percentage of total in each individual table. How did you accomplish this?