cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Spigaw
Helper II
Helper II

Pivoting a full table for a mailing project

Hello dear problem squashers,

 

I have to solve this situation where I have a classic database with as many rows as yearly situations per registration number. In order to be able to use it with Word for a mailing project, I need to fully pivot it to output a database with one line per registration number.

I have this:

Spigaw_1-1638289663967.png

And I need this:

Spigaw_2-1638289676702.png

I was able to do it in Excel with INDEX/MATCH, but it was slow and not ergonomic. And anyway, I want to fully automatize it.

 

When I try to pivot based on the year column in Power Query, it deletes it and does output a lot of null values:

Spigaw_3-1638289817494.png

You can find the database (with obviously fake data) via this link.

 

Thanks in advance for any help!

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

First, unpivot all except the first two columns.

AlexisOlson_0-1638292250009.png

Merge the Year and Attribute into a single column

AlexisOlson_1-1638292314488.png

Then pivot the merged column to get the desired result.

 

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

First, unpivot all except the first two columns.

AlexisOlson_0-1638292250009.png

Merge the Year and Attribute into a single column

AlexisOlson_1-1638292314488.png

Then pivot the merged column to get the desired result.

 

I don't have any comment, except that it works flawlessly.

Thank you so much!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors