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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mbrown10
New Member

Reshaping Economic Data in PowerBI

Hello Friends,

 

PowerBI newbie coming over from Tableau, hoping you might help me with a problem. I am trying to reshape economic data, which comes in horizontal form. The country and metric in a rows and years in the column. 

mbrown10_2-1750867123478.png

 

I need to get it into long form, to make it easier to use in PowerBI. That puts the country and year in rows with the metrics in columns.

mbrown10_1-1750867097104.png

When I go to unpivot the data, something is wrong. I would be deeply appreciative if anyone has experience with this.

 

Thank you!!

Michael

1 ACCEPTED SOLUTION
Syk
Super User
Super User

Welcome to Power BI!
First thing you need to do is unpivot your data. There are a few ways, but for this type of data where 2026 would bring a new column....
1. Select your Country and Metric columns (hold ctrl to select multiple columns) and under the Transform tab > (find arrow on) Unpivot columns > Unpivot Other Columns

Syk_0-1750868567958.png

data should look like this

Syk_1-1750868603643.png

 

2. Select your metric column and pivot this column. A dialog box will ask you which column has your values and just select your newly created values column from the previous step.

Syk_2-1750868703956.png

3. Enjoy the new data structure!

Syk_3-1750868761266.png

 

 

Quick note: The reason you use the unpivot other columns as the first step is that your unpivot only cares that 'Country' and 'Metric' exist. It will unpivot every other column even if another year gets added. You COULD select all the year columns and ask it to unpivot those specifically but when a new year gets added you will need to come back in and adjust it.

 

View solution in original post

2 REPLIES 2
mbrown10
New Member

Thank you so much, especially for the tip on unpivoting other columns. That's so helpful. Thank you!

 

Syk
Super User
Super User

Welcome to Power BI!
First thing you need to do is unpivot your data. There are a few ways, but for this type of data where 2026 would bring a new column....
1. Select your Country and Metric columns (hold ctrl to select multiple columns) and under the Transform tab > (find arrow on) Unpivot columns > Unpivot Other Columns

Syk_0-1750868567958.png

data should look like this

Syk_1-1750868603643.png

 

2. Select your metric column and pivot this column. A dialog box will ask you which column has your values and just select your newly created values column from the previous step.

Syk_2-1750868703956.png

3. Enjoy the new data structure!

Syk_3-1750868761266.png

 

 

Quick note: The reason you use the unpivot other columns as the first step is that your unpivot only cares that 'Country' and 'Metric' exist. It will unpivot every other column even if another year gets added. You COULD select all the year columns and ask it to unpivot those specifically but when a new year gets added you will need to come back in and adjust it.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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