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! Request now

Reply
DiKi-I
Post Partisan
Post Partisan

Need help in data preparation

Hi ,

I have multiple relationship table around 5 to 6 which are available in mutiple tables.
I'm attaching some sample data there are 3 tables table1, table2, table3.

Realtionship is from parent class to child class 

business service->business service line -> department -> IT.


Can someone please help me in the data prepartion ?


https://docs.google.com/spreadsheets/d/1kQODqFakeG88QsMegk5URHtKLiZLyUq-/edit?usp=drive_link&ouid=10...


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DiKi-I ,

 

You can use pivot columns and merger queries in Power Query.

Here's the solution.

1.Start by adding an index column to each table. This index column is designed to prevent errors when pivoting with multiple elements in a row.

vstephenmsft_0-1702532166107.pngvstephenmsft_1-1702532179082.pngvstephenmsft_2-1702532183897.png

vstephenmsft_3-1702532197555.png

2.Pivot columns in each tables.

Take the first table as an example, select the Parentname column and click Pivot Column.

vstephenmsft_4-1702532249396.png

Seleclt Parent column as values and select 'Don't Aggregate'.

vstephenmsft_5-1702532304228.png

vstephenmsft_6-1702532326106.png

Repeat the above steps to get three tables as follows:

vstephenmsft_7-1702532410501.pngvstephenmsft_8-1702532426952.pngvstephenmsft_9-1702532450170.png

 

3.Merge them.

vstephenmsft_11-1702532519922.png

vstephenmsft_10-1702532499805.png

vstephenmsft_12-1702532547743.png

 

4.Expand the column contains tables and merge again.

vstephenmsft_13-1702532701956.png

vstephenmsft_14-1702532707707.png

vstephenmsft_15-1702532720259.pngvstephenmsft_16-1702532727818.png

Expand it again.

vstephenmsft_17-1702532739873.png

5.For the same columns, you can merge them.

vstephenmsft_18-1702532783223.pngvstephenmsft_19-1702532791380.png

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @DiKi-I ,

 

You can use pivot columns and merger queries in Power Query.

Here's the solution.

1.Start by adding an index column to each table. This index column is designed to prevent errors when pivoting with multiple elements in a row.

vstephenmsft_0-1702532166107.pngvstephenmsft_1-1702532179082.pngvstephenmsft_2-1702532183897.png

vstephenmsft_3-1702532197555.png

2.Pivot columns in each tables.

Take the first table as an example, select the Parentname column and click Pivot Column.

vstephenmsft_4-1702532249396.png

Seleclt Parent column as values and select 'Don't Aggregate'.

vstephenmsft_5-1702532304228.png

vstephenmsft_6-1702532326106.png

Repeat the above steps to get three tables as follows:

vstephenmsft_7-1702532410501.pngvstephenmsft_8-1702532426952.pngvstephenmsft_9-1702532450170.png

 

3.Merge them.

vstephenmsft_11-1702532519922.png

vstephenmsft_10-1702532499805.png

vstephenmsft_12-1702532547743.png

 

4.Expand the column contains tables and merge again.

vstephenmsft_13-1702532701956.png

vstephenmsft_14-1702532707707.png

vstephenmsft_15-1702532720259.pngvstephenmsft_16-1702532727818.png

Expand it again.

vstephenmsft_17-1702532739873.png

5.For the same columns, you can merge them.

vstephenmsft_18-1702532783223.pngvstephenmsft_19-1702532791380.png

 

 

Best Regards,

Stephen Tao

 

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

 

 

 

DiKi-I
Post Partisan
Post Partisan

DiKi-I
Post Partisan
Post Partisan

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.