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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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