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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
JS
Helper II
Helper II

Help in Data modelling

Hello. 

 

I need some help with data modelling here! I have the table below - 

 

BuyerGreen AppleRed AppleOrangePineappleKiwiStrawberry
James100000
James000010
Mary010000
Mary000001
Mary100000
John010000
John001000
John000010

 

I would like to convert the table to what is shown below - 

 

BuyerGreen AppleRed AppleOrangePineappleKiwiStrawberry
James100010
Mary110001
John011010

 

 

Is there any quick way to get this done. Any help or advise would be grateful! 

 

Thanks

JS

1 ACCEPTED SOLUTION
DAX0110
Resolver V
Resolver V

Yes, it can be done easily in Power Query:

 

(1) unpivot all the non-Buyer columns, so that you get a table with 3 columns: Buyer, Fruit, Qty

(2) group by both Buyer and Fruit columns, summing over Qty

(3) finally, pivot the Fruit and Qty columns

 

 

View solution in original post

2 REPLIES 2
DAX0110
Resolver V
Resolver V

Yes, it can be done easily in Power Query:

 

(1) unpivot all the non-Buyer columns, so that you get a table with 3 columns: Buyer, Fruit, Qty

(2) group by both Buyer and Fruit columns, summing over Qty

(3) finally, pivot the Fruit and Qty columns

 

 

Thank you!!!! Worked perfectly!!!!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 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.