Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I would like to collect the distinct values in a row of multiple columns & combine them into 1 cell separated with comma in reverse order, as follows:
Could you suggest me a a formula within Power Query to get this result?
Thanks in advance.
Solved! Go to Solution.
you can try this to create a column in PQ
=Text.Combine( List.Distinct( List.Reverse (Record.ToList(_))),",")
Proud to be a Super User!
Use this Custom Column formula in Power Query:
= Text.Combine(List.Distinct(List.Reverse(Record.ToList(_))), ", ")
This gives your required output:
Row 1 → G, F, E, D, C, B, A
Row 2 → I, H, G, F, D, C, B
Hi @BalazsNy ,
I would also take a moment to thank @ryan_mayu , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions
Hi @BalazsNy ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
Hi @BalazsNy ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
you can try this to create a column in PQ
=Text.Combine( List.Distinct( List.Reverse (Record.ToList(_))),",")
Proud to be a Super User!
Hello @BalazsNy
Create a cutome column use below code
Text.Combine(
List.Reverse(
List.Distinct(
List.RemoveNulls(
{
[col1],
[col2],
[col3],
[col4],
[col5],
[col6],
[col7],
[col8],
[col9],
[col10]
}
)
)
),
", "
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.