cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Inserting multiple groups within the x axis

Hi is there any possible way to group multiple column fields within the x axis? I was hoping to show columns urban, rural and town where a field may contain 0 or 1

as shown in the image: image

The here is how the column works:

Urban | Rural | Town

0            1           0

1            0           0

0            0           1

So in effect, it should make 3 bars, but it only shows the value for urban 1 and 0. Hope you can help me as I'm still trying to figure out how power BI works. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Inserting multiple groups within the x axis

Hi @Anonymous 

 

Not sure if you'd like to get below result:

8.PNG

You'll need to make some transformation in power query. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlDSUTIEYgOlWJ1oKAvGM4DyDJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Urban " = _t, Rural = _t, Town = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Urban ", Int64.Type}, {"Rural", Int64.Type}, {"Town", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value")
in
    #"Unpivoted Columns"

Pbix attached.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Inserting multiple groups within the x axis

Hi @Anonymous 

 

Not sure if you'd like to get below result:

8.PNG

You'll need to make some transformation in power query. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlDSUTIEYgOlWJ1oKAvGM4DyDJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Urban " = _t, Rural = _t, Town = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Urban ", Int64.Type}, {"Rural", Int64.Type}, {"Town", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {}, "Attribute", "Value")
in
    #"Unpivoted Columns"

Pbix attached.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors