Search code examples
powerbipie-chartdaxpercentage

PBI - How to group by column name in pie chart along percentage (with values displayed)?


I'm having trouble with use group by on pie chart - maybe it can be done differently.

I have a simple pie chart with only 2 values: Name, and their values (grouped by the Name).

The values are an amount and not a percentage. (The percentage may be displayed as well, but only if the amount will be displayed also).

And I need to somehow (I guess with group by) rename all the Names where the percentage ratio in this chart lower than, for example, 10% to a different string, like Group_with_10per_or_lower.

Any ideas how this can be done?


For example, imagine having States and their values of something. USA = 350; Canada = 250, Brazil = 200, Argentina = 150, Chile = 50. And what you have is a pie chart with these data. But you need to rename all states having 20% or less ratio of this value (Brazil, Argentina, and Chile) as Other for example. So you would have the pie chart with USA, Canada, and Other (Brazil + Argentina + Chile) but still have their values displayed in the chart and not their %. It can be both, but not just %.


Solution

  • Let's say you have a table Table1(state, value)

    Create a measure:

    Total = CALCULATE(SUM(Table1[value]),All(Table1))
    

    Create a calculated column:

    state2 = IF([value]<[total]*0.2,"Other",[state])
    

    Use state2 in your visualisation.

    enter image description here