cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyPhan
Kudo Kingpin
Kudo Kingpin

Nested Concat

Hi All,

I am using the Concat function to generate a HTML table based on a collection. This is similar to what is being done here. For my application It would be very nice to have a concat funcation nested inside another Concat funcation (similar to having a for loop inside another for loop in C). However Im not sure how to reference the 'Result' of the child Concat.

 

For example:

if we have table a and b below:

Table A Table B
1 a
2 b
3 c



and I try to do this:
Concat( A, concat(B,  "A:" & Result & " B: " & Result & "<br /> ")

I hope to get something like:
A: 1 B:a
A: 1 B:b

A: 1 B:c
A: 2 B:a
A: 2 B:b
A: 2 B:c
A: 3 B:a
A :3 B:b
A :3 B:c


How can i distinguish A.Result from B.Result?? At the moment Result will always reference the result of the parent Concat.

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Community Champion
Community Champion

 

You can use RenameColumns() to rename the Result for either of them.

 

Assuming your formula is already working:

Concat(A, Concat(RenameColumns(B,"Result","Result_B"),  "A:" & Result & " B: " & Result_B & "<br /> ")

The renaming is not permanent and is only scoped to the formula.

 

Let me know if this works for you.

Microsoft Employee
@8bitclassroom

View solution in original post

2 REPLIES 2
mr-dang
Community Champion
Community Champion

 

You can use RenameColumns() to rename the Result for either of them.

 

Assuming your formula is already working:

Concat(A, Concat(RenameColumns(B,"Result","Result_B"),  "A:" & Result & " B: " & Result_B & "<br /> ")

The renaming is not permanent and is only scoped to the formula.

 

Let me know if this works for you.

Microsoft Employee
@8bitclassroom

View solution in original post

Cheers! this worked perfectly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,238)