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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to combine many columns for different years into two columns

Hi guys,

I have a table with following columns:

noahnaru11_0-1615199866036.png

Now, I want to create a line diagram with the years as x-axis to show the change of the price over the years.

My idea was to merge these columns into two columns "price" and "year", but I don't know how to do that.

Does someone of you have a solution how to handle this or even a more convenient approach to create the line diagram?

 

Best regards

1 ACCEPTED SOLUTION

@Anonymous 

If possible share the pbix with dummy data, we can have a look and send you back.

Or you can check if numbers columns are in number format.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous,

I think unpivot column should suitable for your scenario, you can refer to the following link to know more about this.

Unpivot columns (Power Query) 

If the above not help, can you please share a pbix file with some dummy data to test?

How to Get Your Question Answered Quickly

Regards,
Xiaoxin Sheng

mhossain
Solution Sage
Solution Sage

@Anonymous 

 

Select your all the number columns and Go to Transform in toolbar-- click Unpivot see below pic.

This will transform into two columns Attribute having column names, you can clean these to have year.

Second column you have your numbers.

 

mhossain_0-1615203485479.png

 

Let me know if this solves.

 

 

Anonymous
Not applicable

No. No matter which columns I select to unpivot, I get errors in every cell.

 

noahnaru11_0-1615288629836.png

 

@Anonymous 

If possible share the pbix with dummy data, we can have a look and send you back.

Or you can check if numbers columns are in number format.

Anonymous
Not applicable

Hi! The columns were not in number format. After I changed it, it worked. Thank you!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors