Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Heelo dear community,
I'm struggling to develop the code to obtain the 3 output below.
My table contains 2 columns... Fruit and Name.
It surely as to do with List but cannot make it work.
Help would be appreciated.
| Output 1 | Output 2 | Output 3 | ||
| Fruit | Name | Count Fruit Frequency | Customer (no duplication) | Customer (w/duplication) |
| Apple | Dan | 2 | Dan , Irene | Dan , Irene |
| Banana | Justin | 1 | Justin | Justin |
| Apple | Irene | 2 | Dan , Irene | Dan , Irene |
| Pear | Dan | 4 | Dan, Bob, Jack | Dan, Bob, Jack, Dan |
| Pear | Bob | 4 | Dan, Bob, Jack | Dan, Bob, Jack, Dan |
| Pear | Jack | 4 | Dan, Bob, Jack | Dan, Bob, Jack, Dan |
| Pear | Dan | 4 | Dan, Bob, Jack | Dan, Bob, Jack, Dan |
Solved! Go to Solution.
You can add Custom Column:
For Customer with duplications, in the Custom Column dialog box:
Text.Combine(
Table.SelectRows(#"Changed Type", (r)=>r[Fruit]=[Fruit])[Name], ", ")
For Customer with no duplications:
Text.Combine(List.Distinct(
Table.SelectRows(#"Changed Type", (r)=>r[Fruit]=[Fruit])[Name]), ", ")
You can add Custom Column:
For Customer with duplications, in the Custom Column dialog box:
Text.Combine(
Table.SelectRows(#"Changed Type", (r)=>r[Fruit]=[Fruit])[Name], ", ")
For Customer with no duplications:
Text.Combine(List.Distinct(
Table.SelectRows(#"Changed Type", (r)=>r[Fruit]=[Fruit])[Name]), ", ")
Hi @DanFromMontreal , You could Achive this with Power Query with Group By Try this please
Hi @DanFromMontreal , here's the solution to your query. I'll attach the output image and the snippet of the M code used below for reference. Thanks
Thank you SundarRaj - its working 🙂
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 7 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 11 | |
| 10 | |
| 9 |