0
votes

I have several measures in Power BI.

[A],
[B],
[C],
[D],
[Total Expenses]

Where A + B + C + D = Total Expenses. For this example, let's say the first 4 measures = 25 and the Total Expenses measure = 100

I want to create a Pie Chart that will show me the allocation of selected Expenses compared to the total. In other words, if I select A, B, and D (in a filter for example). Then I want the Pie Chart to show me A = 25%, B = 25%, C = 25%, Other = 25%. If I remove A, then Other should become 50%.

I was thinking this might be possible with something like the SWITCH function... but can't really imagine how to start. I will also accept alternative functions I haven't heard of that might lead to the desired solution...

1
This is a bit of an odd request. Measures don't typically go in slicers/filters and pie charts don't typically operate on multiple measures (you put one measure in the Values section). - Alexis Olson

1 Answers

0
votes

I'm not sure exactly what you are after, but this might prove instructive.

If I set up a table like this:

Table

And a measure like this:

Other = IF(SELECTEDVALUE(Pie[Type]) <> "Other",
        SUM(Pie[Amount]),
        CALCULATE(SUM(Pie[Amount]), ALL(Pie[Type])) - CALCULATE(SUM(Pie[Amount]), ALLSELECTED(Pie[Type])))

Then I can get a pie chart that behaves like you describe (where Type goes in the Legend field and the [Other] measure goes in the Values field.

Pie Chart