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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
adamavix
Regular Visitor

Pivoted data with custom clustered column chart

For a very simple example, say I have table with rows:

 

{name = a, M1 = 10, M2 = 20},

{name = a, M1 = 15, M2 = 10},

{name = b, M1 = 15, M2 = 10}

 

So obviously we can combine this (say with sum) to just give us:

 

{name = a, M1 = 25, M2 = 30}

{name = b, M1 = 15, M2 = 10}

 

When I plot this (say clustered column chart), it will have names (a and b) on the axis, and the values of M1/M2 for each index as clustered column bars. For example, name "a" will be on the axis and have two bars for M1 = 25, M2 = 30. 

 

 

My question is, is it possible to flip this to be M1 on the axis with two bars with a = 25 and b = 15? I can make a complicated function that regoups M1/M2 using power query m, but it is slow and I think there must be a simpler way or that I am not approaching this the correct way. Essentially, I can make the table below and get this to work, but it is not optimal. 

 

{month = M1, a = 25, b = 15}

{month = M2, a = 30, b = 10}

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@adamavix,

 

The simple way is to use unpivot columns in Query Editor.

Community Support Team _ Sam Zha
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

3 REPLIES 3
Dimani
Helper II
Helper II

Hi,

I was about to ask whether there is a way to plot pivoted data (already in a table, for example, in an Excel worksheet) in Power BI as if they are unpivot data.  But then I saw this thread about the unpivot option in the query editor.

This thread was started a few years ago, and I wonder if there is any new development in Power BI that will graph pivoted data as if they are not pivot.  By the way, I am using an older version of Power BI (May 2021 RS).  If that makes any difference.

 

Thanks

v-chuncz-msft
Community Support
Community Support

@adamavix,

 

The simple way is to use unpivot columns in Query Editor.

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

That worked perfectly (I’m new to power query) thank you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors