Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Teams,
I want to write concatenates dax function to group subcategory according to their category group .
Here is example -
and i want this following output -
I want this for measures and calculatedtable as well
Thanks & Regards
Sudeep Kumar
Solved! Go to Solution.
Hi @Sudip_J - create a calculated table with one row per Category and a comma-separated list of Subcategories.
CategoryWithSubcategories =
ADDCOLUMNS (
VALUES ( 'YourTable'[Category] ),
"Subcategories",
CONCATENATEX (
FILTER (
'YourTable',
'YourTable'[Category] = EARLIER ( 'YourTable'[Category] )
),
'YourTable'[Subcategory],
", ",
'YourTable'[Subcategory],
ASC
)
)
using measure:
Subcategories Measure =
CONCATENATEX (
VALUES ( 'YourTable'[Subcategory] ),
'YourTable'[Subcategory],
", ",
'YourTable'[Subcategory],
ASC
)
Hope this works and helps.
Proud to be a Super User! | |
You can do this with a DAX measure, here's the code:
Measure =
CONCATENATEX(
DISTINCT(
SELECTCOLUMNS(
{{YOUR_TABLE}},
{{YOUR_TABLE}}[Category],
{{YOUR_TABLE}}[Sub_Category]
)
),
{{YOUR_TABLE}}[Sub_Category],
", "
)Whenever this measure is present with a Category, it will show all Sub_Categories underneath it in a comma-delimeted list. No need for a seperate calculated table at all.
Hi,
Write this measure
Measure = CONCATENATEX(VALUES(Data[Sub_Category]),Data[Sub_Category],",")
Hi @Sudip_J ,
Thanks for reaching out to the Microsoft fabric community forum.
I Have you used this Dax measure to create the output you required.
SubCategoryList_Measure =
CONCATENATEX(
VALUES('Table'[Sub_Category]),
'Table'[Sub_Category],
", "
)
This is the screenshot of the output that I got
Uploading the .pbix file for reference, Please check and let us know if you would like any changes to the output.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi Rajendra,
Thanks for providing the answer .Let me inform you that your dax measure works but for calculated table it is still not working .
Hi @Sudip_J
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Sudip_J ,
Thanks for reaching out to the Microsoft fabric community forum.
I Have you used this Dax measure to create the output you required.
SubCategoryList_Measure =
CONCATENATEX(
VALUES('Table'[Sub_Category]),
'Table'[Sub_Category],
", "
)
This is the screenshot of the output that I got
Uploading the .pbix file for reference, Please check and let us know if you would like any changes to the output.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi,
Write this measure
Measure = CONCATENATEX(VALUES(Data[Sub_Category]),Data[Sub_Category],",")
Hi Rajendra ,
Thanks for taking the time to respond! I appreciate the input.The solution you provided seems to mismatch
Could you please clarify if I misunderstood something? I attached your answer in the below attached image please go through it .
You can do this with a DAX measure, here's the code:
Measure =
CONCATENATEX(
DISTINCT(
SELECTCOLUMNS(
{{YOUR_TABLE}},
{{YOUR_TABLE}}[Category],
{{YOUR_TABLE}}[Sub_Category]
)
),
{{YOUR_TABLE}}[Sub_Category],
", "
)Whenever this measure is present with a Category, it will show all Sub_Categories underneath it in a comma-delimeted list. No need for a seperate calculated table at all.
Hi @Sudip_J - create a calculated table with one row per Category and a comma-separated list of Subcategories.
CategoryWithSubcategories =
ADDCOLUMNS (
VALUES ( 'YourTable'[Category] ),
"Subcategories",
CONCATENATEX (
FILTER (
'YourTable',
'YourTable'[Category] = EARLIER ( 'YourTable'[Category] )
),
'YourTable'[Subcategory],
", ",
'YourTable'[Subcategory],
ASC
)
)
using measure:
Subcategories Measure =
CONCATENATEX (
VALUES ( 'YourTable'[Subcategory] ),
'YourTable'[Subcategory],
", ",
'YourTable'[Subcategory],
ASC
)
Hope this works and helps.
Proud to be a Super User! | |
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 48 | |
| 37 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 85 | |
| 70 | |
| 38 | |
| 28 | |
| 25 |