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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bestbestb
New Member

Pivot rows to columns with multiple values

Hi,

 

I want to pivot the "charge_name" column shown below with 10+ catagories: 

bestbestb_0-1632321271276.png

I need to pivot using two value fields, qty and amount respectively:

bestbestb_1-1632321635064.png

Here's how I did it:  I duplicated the charge name column and pivoted the columns using amount and quantity respectively.

I also had to change the pivoted column names otherwise i would get duplicate error when I do quantity.

 

Is there a better/smarter way to do this?

 

Any suggestion appreciated,

 

Thanks!

2 REPLIES 2
Anonymous
Not applicable

@bestbestb 
I don't know your solution step by step so it is hard to say. I cannot think of any better without any test. If you already have a solution, should stick with it. Simple pivot and unpivot steps would not slow the query speed.

 

 

Paul Zheng _ Community Support Team

Ehren
Microsoft Employee
Microsoft Employee

There may be a better way, but your approach is probably the one I would have taken.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.