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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

combine 2 nested tables within separate columns

I have a list "5 to rank" which I also converted to a table "TableFFromlisttest".

I would like to achieve the TableFFromlisttest [Table] to have an extra column which i can then perform a Group by List Max or similar to final show only the largest amount with corresponding Column1value. 

Final result.png

The "levytable" [Table] is actually refering to the "Levy" table highlighted in yellow which is another query.

levytable column.jpg

What m code can I use so firstly this sub step is achieved1st sub step.jpg

 

I've tried to use Table.Combine 

 

= Table.AddColumn(#"Removed Other Columns", "Custom", each Table.Combine(([TableFFromlisttest]),([levytable])))

 

 but it doesn't work 

 

Expression.Error: We cannot convert a value of type Table to type List.
Details:
    Value=[Table]
    Type=[Type]

 

 

Any assitance would be appreciated

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I may have found a solution using:

= Table.AddColumn(Levies, "Custom.1", each Table.ExpandTableColumn(Table.NestedJoin([TableFFromlisttest], {"Column1"}, [levytable], {"Wording in Regs"}, "Testtable2", JoinKind.LeftOuter),"Testtable2", {"Levy $"}, {"Levy $"}))

Leroy_1-1660008653161.png

result

Result.jpg

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I may have found a solution using:

= Table.AddColumn(Levies, "Custom.1", each Table.ExpandTableColumn(Table.NestedJoin([TableFFromlisttest], {"Column1"}, [levytable], {"Wording in Regs"}, "Testtable2", JoinKind.LeftOuter),"Testtable2", {"Levy $"}, {"Levy $"}))

Leroy_1-1660008653161.png

result

Result.jpg

Anonymous
Not applicable

I didn't have curly brackets. 

= Table.AddColumn(Levies, "Custom", each Table.Combine({[TableFFromlisttest],[levytable]}))

once added I get

Leroy_2-1659932807433.png

I need somehow from this nested table to get the matching Levy $ for the words in Column1

Anonymous
Not applicable

I've managed to get most of the solution myself using

    #"Added Custom12" = Table.AddColumn(#"Removed Columns", "Custom.1", each Table.SelectRows([levytable], each List.Contains(MyList,[WordinginRegs]))),
    #"Added Custom6" = Table.AddColumn(#"Added Custom12", "Custom", each Table.Max([Custom.1],"Levy $")),
    #"Expanded Custom1" = Table.ExpandRecordColumn(#"Added Custom6", "Custom", {"WordinginRegs"}, {"WordinginRegs"}),

except for refering to the 'static list 'MyList' instead of the List within the column [5 to rank]ListContainsMyList.jpg

 

Does anyone have any ideas?

Anonymous
Not applicable

I've worked out how to get the Max from the table

= Table.AddColumn(#"Added Custom12", "Custom", each Table.Max([Custom.1],"Levy $"))

giving a record

Max gives record.jpg

which when expanded gives the result I'm after

Expanded.jpg

 Then only issue remaining is how to point to the List within the "5 to rank" column instead of my 'test list' called "MyList" which sits externally to the table i'm in

 

 

wdx223_Daniel
Super User
Super User

NewStep=Table.CombineColumns(PreviousStepName,{"TableFFromlisttest","leveytable"},each Table.AddColumn(_{0},"Levy $",each _{1}{[WordinginRegs=[Column1]]}?[#"Levy $"]?),"TableFFromlisttest")

Anonymous
Not applicable

I'm partially there using this code

= Table.AddColumn(#"Removed Other Columns", "Custom.1", each Table.SelectRows([levytable], each List.Contains(MyList,[WordinginRegs])))

However the MyList was a test List. I would like the "list' component to point to each list within the 5 to rank column

5 to rank list.jpg

ListContainsMyList.jpg

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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