Custom grouping on bar charts?

I'll do the best to describe what Im.trying to do, but i'm on mobile so bear with me.

Say I have data similar to this:

Michigan primary: 10% Michigan remaining: 15% Illinois primary: 12% Illinois remaining: 13% Ohio primary: 8% Ohio remaining: 9%

How can I make a bar chart that groups together Michigan primary and remaining, then a space, then Illinois primary and remaining, then a space, then Ohio primary and remaining?

This is possible in excel so it's gotta be possible in Power BI...

Posted Mar 9, 2020, 12:02 PM UTC

12
Jorennnnnn•

You can create 2 measure and put the state on the axis.

Depending on the structure of your data this varies, but generally speaking it should look like the following:

Measure remaining = CALCULATE(<calculation>; Column = "Remaining")

Measure primary = CALCULATE(<calculation>; Column = "Primary")

Hope it helps

1
fussi1997•

Or you could split the "Michigan primary"-column by the delimiter " " in the Power Query-Editor and then aggregate the percentages by the column you just created (the State names)

1