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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
umutulutas
Frequent Visitor

Aggregating nested tables

Hi all,

 

I have a table like this, where each row represent an id and another table:

dddd.png

And each row's specific table looks like this:

ffff.png

I want to take values from each row's table and add those as columns to my first table, where values at first column will be the name of the new columns I will add and values at second column will be the values for each ID's respective column.


For example there will be a new columns called standard_of_tea, photoshoot_success etc. in the first table, and those column will be filled acording to specific row's scores.

 

What I mean is at the end, I expect it to look like this (dont mind the actual values, I just copy paste it to visualize it):

asdfasdf.png

How can this tranformation be achieved using Power Query?

Maybe this is a very begginner level problem but I am kind of stuck at this.

 

Thanks very much

1 ACCEPTED SOLUTION

Hi @umutulutas ,

 

After getting the result above, click on the column Detail.Name , go to Transform->Pivot Column, and make pivot settings like picture below.

60.png

 

 

Best Regards,

Amy

 

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
v-xicai
Community Support
Community Support

Hi @umutulutas ,

 

You may click the expand icon in upper right corner of the column header. In the column names drop-down, choose any columns you are not interested in. see more details: Expand a column containing a related table (Power Query).

 

Best Regards,

Amy

 

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

Hi @v-xicai 

 

Thanks for reply, very helpful, it seems like the step in the right direction.

 

However when I do that, the table becomes like this:

 

| Visit ID          | Detail.Name                 | Detail.Value |

| id_of_visit_1  | pepsi_posm                  | 1                  |

| id_of_visit_1  | standard_of_tea            | 1                  |

| id_of_visit_1  | standard_of_juice          | 1                  |

| id_of_visit_2  | pepsi_posm                  | 1                  |

| id_of_visit_2  | standard_of_tea            | 1                  |

| id_of_visit_2  | standard_of_juice          | 1                  |

 

So each score added as a row where visit ID is duplicated. What I want instead is this:

| Visit ID          | pepsi_posm  | standard_of_tea | standard_of_juice |        

| id_of_visit_1  | 1                   | 1                         | 1                           |

| id_of_visit_2  | 1                   | 1                         | 1                           |

 

Thanks again

Hi @umutulutas ,

 

After getting the result above, click on the column Detail.Name , go to Transform->Pivot Column, and make pivot settings like picture below.

60.png

 

 

Best Regards,

Amy

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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