Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
trevorg
New Member

PowerBI - Clustered bar chart for time phased data with mutiple column attributes.

How to create a 'clustered bar chart' for aggregated data that is using the same row with three different attributes.

 

For some reason I cannot find a way for the 'series/shared axis' to be split by column attribute. (It will only use one column attribute at a time, like 'Planned', but not all three).

 

Example dataset:

 

TitleValuePlanActualForecast
Row 110Jan 2020Jan 2020 
Row 215Feb 2020 Feb 2020
Row12Feb 2020 Mar 2020

 

Something like this would be the result:

 

 ClusteredBarChartExample.PNG

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This unpivot transform should help you to get your data into a usable format.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsovVzBU0lEyNAASXol5CkYGRmhMBaVYHYhCI5BCUyDhlpqEkEXiQhWClBlhKvNNLIIqiwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Title = _t, Value = _t, Plan = _t, Actual = _t, Forecast = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Title", "Value"}, "Attribute", "Value.1")
in
    #"Unpivoted Other Columns"

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @trevorg 

 

If the above posts help. plz kindly mark it as answer to help others find it more quickly.

 

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.
amitchandak
Super User
Super User

@trevorg , with multiple columns you can not have a legend.

 

If you want these columns as a legend , you need to unpivot your data.

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

 

This solution worked for me. Thank you.

 

I cannot mark it as accepted, for some reason the javascript is being blocked on my work browser.

lbendlin
Super User
Super User

This unpivot transform should help you to get your data into a usable format.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsovVzBU0lEyNAASXol5CkYGRmhMBaVYHYhCI5BCUyDhlpqEkEXiQhWClBlhKvNNLIIqiwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Title = _t, Value = _t, Plan = _t, Actual = _t, Forecast = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Title", "Value"}, "Attribute", "Value.1")
in
    #"Unpivoted Other Columns"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.