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
lekkerbek
Helper IV
Helper IV

Unpivot columns

Hi,

 

The solution is probably easy, but I can't get it to work as the outcome is not the same if I manually calculate.

 

I have an excelsheet covering the following:

 

Article nrArticle group0-30 number0- 30 value31-60 number31-60 value61-90 number61-90 value
001Article name1€ 10,505€ 52,502€ 21

 

I would like it to look like:

 

Article nrArticle groupAgeNumberValue
001Article name0-301€ 10,50
001Article name31-605€ 52,50
001Article name61-902€ 21

 

Could someone help me with this please? When I tried unpivotting I got duplicates and when I tried to remove those I apparantly removed too much as the total sum did not match the excelsheet anymore.

 

Screenshot.PNG

 

 

Thanks in advance. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lekkerbek ,

 

Please follow the below steps to acheive your request. 

  • First Unpivot the columns Fig 1.1
  • Split the columns based on space delimiter to the Right-most delimiter Fig 1.2 and 1.3.
  • Pivot the Number and Values to columns based on Value column Fig1.4.


Fig 1.1:
Unpivot.PNG

Fig 1.2:

Delimit.PNG

Fig 1.3:
Split_Columns.PNG
Fig 1.4:
Final.PNG

 


Best Regards,
Mail2inba4

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @lekkerbek ,

 

Please follow the below steps to acheive your request. 

  • First Unpivot the columns Fig 1.1
  • Split the columns based on space delimiter to the Right-most delimiter Fig 1.2 and 1.3.
  • Pivot the Number and Values to columns based on Value column Fig1.4.


Fig 1.1:
Unpivot.PNG

Fig 1.2:

Delimit.PNG

Fig 1.3:
Split_Columns.PNG
Fig 1.4:
Final.PNG

 


Best Regards,
Mail2inba4

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you both @Anonymous  and @Tahreem24 for your time to help me. Much appreciated.

Tahreem24
Super User
Super User

@lekkerbek ,

You want something like below screen shot? (I tried to replica your requirement at my side)

Please Give KUDOS to my post and accept this as a solution if it helps you!

 

Capture.JPG

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@lekkerbek ,

 

Yeah, the Number Column is nothing but the Value column.

Capture.JPG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

The number column should reflect the number of articles in stock. The value column reflects the total value of the stock of that article. Those two can't be combined into one column.

@lekkerbek ,

 

Can you please give screen shot or upload Excel with sample data?

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

I seem to be unable to upload an excelfile, so I included a screenshot in the opening post (and also here).

 

Screenshot.PNG

 

Hi @lekkerbek ,

 

I replicated your scenario at my end. Let me know if I missed anything. 

Please dont forget to give KUDOS!

 

Input:

Input.JPG

 

Output:

Output.JPG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24  yes, but it should also include the column "value".

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.