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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gomezc73
Helper V
Helper V

How Unpivot two columns of amounts

Hi Expert,

 

    I hope you can help me with this request. 

 

    I have a file with two amount by month for each code of product:

    a) The first amount is the monthly sales and

    B) The second amount is the accumulated by month.

 

    Something like this:

codeDescriptionJanAcum JanFebAcum FebMaracum MarAprAcum Apr
AACode Red              500              500              758          1,258              996          2,254          1,509          3,763
ABCode Green              750              750          1,137          1,887          1,496          3,383          2,268          5,651
ACCode Blue          1,200          1,200          1,800          3,000          2,340          5,340          3,510          8,850

    

I need convert the file and unpivot the amounts columns to generate two columns of amounts by month.

 

 Something like this:

     

codeDescriptionMonthMonthly AmtAcumulated Amt
AACode RedJAN        500                  500
AACode RedFEB        758             1,258
AACode RedMAR        996             2,254
ABCode GreenJAN        750                  750
ABCode GreenFEB    1,137             1,887
ABCode GreenMAR    1,496             3,383
ACCode BlueJAN    1,200             1,200
ACCode BlueFEB    1,800             3,000
ACCode BlueMAR    2,340             5,340

 

Is it possible?

 

Thanks in advance

 

Regards 

 

1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

Hi @gomezc73 

Please find the attached PBIX file.
I have used month sort to match your expected data, you can ignore those steps
Please check the Power Query steps

PijushRoy_0-1734725591598.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

3 REPLIES 3
PijushRoy
Super User
Super User

Hi @gomezc73 

Please find the attached PBIX file.
I have used month sort to match your expected data, you can ignore those steps
Please check the Power Query steps

PijushRoy_0-1734725591598.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





I tried repeating all the steps and it worked perfectly. Thank you very much. You are the best.

thank you so much for your early response.

 

 Can you send me the steps, how Pivot the data?. i can't find the option to do that.

 

gomezc73_0-1734727084946.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.