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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everyone,
I am new to powerbi and trying to figure out the bese solution for grouping the the values in ID column based on values in the code column. Below is the table for reference.
| ID | Code |
| 1 | ABC |
| 1 | ABC |
| 1 | ABCD |
| 2 | ABC |
| 3 | ABC |
| 4 | XYZ |
| 4 | XYZ |
This is what I want to display in the table visual:
| ID | Code |
| 1 | ABC & ABCD |
| 2 | ABC |
| 3 | ABC |
| 4 | XYZ |
Any help is greatly appreciated. Thank you!
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
One of ways is to use CONCATENATEX DAX function in a measure.
Code measure: =
IF (
HASONEVALUE ( Data[ID] ),
CONCATENATEX ( DISTINCT ( Data[Code] ), Data[Code], " & " )
)
Hi,
Please check the below picture and the attached pbix file.
One of ways is to use CONCATENATEX DAX function in a measure.
Code measure: =
IF (
HASONEVALUE ( Data[ID] ),
CONCATENATEX ( DISTINCT ( Data[Code] ), Data[Code], " & " )
)
Thank you for your prompt response! This solution worked perfectly for my use case. I hope I learn tricks and trade from super users like you. I greatly appreciate your assistance!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |