Forum Discussion
WinterMist
2 years agoImpactful Individual
DAX Comma Separated Product Values Within Table Visual
Hello Community - The test PBIX is located here: https://drive.google.com/file/d/1FoKbRlzzW378owG71w_qwDVfkxCwLP9x/view?usp=sharing The following table visual exists, with 4 rows for 202...
- 2 years ago
Try this:
List of Product Names = CALCULATE( CONCATENATEX( filter( all('Product'), 'Product'[ProductKey] in VALUES('Fact Sales'[ProductKey])), 'Product'[Product Name], ", ", 'Product'[Product Name], asc))
WinterMist
2 years agoImpactful Individual
Thank you. This is excellent!
I will definitely mark this as a solution.
However, just had a question first.
I created a second measure [02 Product List] and noticed that it returns the same desired results. The only difference is that the CALCULATE is removed. So from the results, it appears that the CALCULATE makes no difference. Am I wrong about this? Is there a recommended reason for leaving CALCULATE in the measure?
Regards,
Nathan
sevenhills
2 years agoSuper User
You are right that we don't need CALCULATE. Good catch!
Typically, I do this of more habit.
CALCULATE(Sum(Table1[Column2Calc]), Filter ( all (Table1), Table1[Column1] = .... )
So started with this, which works and later changed and pasted.
CALCULATE(
CONCATENATEX('Product', 'Product'[Product Name], ", ", 'Product'[Product Name], asc)
, filter( all('Product'), 'Product'[ProductKey] in VALUES('Fact Sales'[ProductKey]))
)
Regards