Forum Discussion
Combining Data, Separated by a Comma when Matching value in One Column in Power BI Desktop
sevenhills Thank you for your help, this halfway helped me out.
Using the new measure within the table for the State worked perfectly, however the store is still not working correctly. Not sure what I'm missing as I did the fromula exactly how you wrote it out for both and the States came back fine, but the store still just pulled in every single store number.
ccolletti , the logic is same and not sure where it went wrong. Can you post the DAX?
Simple thumb rule: it should work for both the same way. As you have seen, DAX is simple code. All we are doing is getting distinct and concatenex.
- ccolletti3 years agoHelper I
sevenhills, agreed I figured it would work with State working. And not able to post in DAX, table is locked down by IT. Only have the ability to access the data for design purposes.
- sevenhills3 years agoSuper User
It is not possible to help without knowing the table, dax and the issue.
Let us do Power Query route:
Ask them to try in Power Query and see if that works there?Say, you have table as below:
Note: Store is marked as text.
Add a group by step as below:
= Table.Group(#"Changed Type", {"Vendor"}, { {"States", each Text.Combine ( List.Distinct([State], Comparer.OrdinalIgnoreCase), ", "), type text} , {"Stores", each Text.Combine ( List.Distinct([Store], Comparer.OrdinalIgnoreCase), ", "), type text} })and you can see the output as
Another advantage is Power Query stores, where as Measure calculates in run time.
Hope this helps!