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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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