Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |