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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Sailor_Leroy
New Member

Equivalent behavior to Switch Rows-Columns in Excel

Below is an example of a table of data which I've been asked to put into a visual:

 

Month_YearAggPct1AggPct2AggPct3AggPct4AggPct5AggPct6
Jan-2124.0629.832.8634.8136.1137.21
Feb-2128.7635.7439.0441.743.1944.37
Mar-2128.234.0637.2439.5941.3942.68
Apr-2124.3329.4832.5335.0236.2437.17
May-2125.331.0334.6936.7938.0739.15
Jun-2126.9234.0437.2239.5641.1742.4
Jul-2126.7331.3834.7837.3638.9440.04
Aug-2128.0332.7436.539.0140.2541.25
Sep-2130.1336.24042.4243.7543.75
Oct-2125.0631.3134.4836.3636.3636.36
Nov-2124.0329.5932.132.132.132.1
Dec-2128.7733.3733.3733.3733.3733.37

 

In both Excel and Power BI I can generate a line chart that looks like this: Excel_Before_Row-Column_Switch.png

 

Within Excel, right-click and Source Data, there's an option to Switch Rows and Columns:

Switch_Dialog_Excel.png

 

That yields a chart like the image below.  Personally I don't understand the benefit of this visual, but I'm only expected to replicate it at this time as we attempt to automate/move reporting to Power BI.

Excel_After_Row-Column_Switch.png

 

No matter what I try to do, I'm unable to replicate this "inversion" and am not enough of a data scientist to understand how to accomplish a change like this.  What options - whether Power Query, DAX, measures, or something to do with the visuals themselve - do I have to accomplish this goal?

1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

I think if you went into power query.

Selected your Month_Year column and then on the transform tab clicked unpivot other columns. You should then find it easier to build the graph you want.

 

https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882...



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
Sailor_Leroy
New Member

Thank you - I had played around with pivot/unpivot but never got it quite right.  This turned out like what was desired, and I can tweak from here... had to figure out axis, legend, values on the line chart after unpivot.  Your help was much appreciated as this might save me from having to do manual work in Excel every month!

Solved_PBI.png

bcdobbs
Community Champion
Community Champion

I think if you went into power query.

Selected your Month_Year column and then on the transform tab clicked unpivot other columns. You should then find it easier to build the graph you want.

 

https://support.microsoft.com/en-us/office/unpivot-columns-power-query-0f7bad4b-9ea1-49c1-9d95-f5882...



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.