Forum Discussion
Anonymous
6 years agoNot applicable
Conditional Title using Quick measure calculation 'Concatenated list of values'
Hello all, My goal is to use a Card-Visualization to list all selected filters from a slicer. For this I used a quick measure and selected 'Concatenated list of values'. While this gets me the re...
- 6 years ago
Hi Anonymous ,
I got this working by creating a measure as shown below:
new Check =var total = CALCULATE(COUNT(ColorSample[color]), ALL(ColorSample[color]))RETURNIF(HASONEVALUE(ColorSample[color]), SELECTEDVALUE(ColorSample[color]), IF(COUNT(ColorSample[color]) > 1 && COUNT(ColorSample[color]) < total, CONCATENATEX(VALUES(ColorSample[color]), ColorSample[color], UNICHAR(10)) , "All Selected"))NOTE: "ColorSample[color]" is my color columns with different color values. Replace this with your column.Move this measure to your card visual. You get as follows:1. when selected few values from slicer:2. When everything is selected:Hope this works for you.If it works please mark this as a solution 🙂Thanks,Pragati - 6 years ago
HI Anonymous
Just modify the measure to the following:
new Check = var total = CALCULATE(COUNT(ColorSample[color]), ALL(ColorSample[color])) RETURN IF(HASONEVALUE(ColorSample[color]), SELECTEDVALUE(ColorSample[color]), IF(COUNT(ColorSample[color]) > 1 && COUNT(ColorSample[color]) < total, CONCATENATEX(VALUES(ColorSample[color]), CONCATENATE(ColorSample[color], ","), UNICHAR(10)) , "All Selected"))This will work and give you desired output.I generally use https://docs.microsoft.com/en-us/dax/ to refer to DAX functions in Power BI.Give Kudos and accept as a solution! 🙂Thanks,Pragati
Pragati11
Super User
6 years agoHi Anonymous ,
I got this working by creating a measure as shown below:
new Check =
var total = CALCULATE(COUNT(ColorSample[color]), ALL(ColorSample[color]))
RETURN
IF(HASONEVALUE(ColorSample[color]), SELECTEDVALUE(ColorSample[color]), IF(COUNT(ColorSample[color]) > 1 && COUNT(ColorSample[color]) < total, CONCATENATEX(VALUES(ColorSample[color]), ColorSample[color], UNICHAR(10)) , "All Selected"))
NOTE: "ColorSample[color]" is my color columns with different color values. Replace this with your column.
Move this measure to your card visual. You get as follows:
1. when selected few values from slicer:
2. When everything is selected:
Hope this works for you.
If it works please mark this as a solution 🙂
Thanks,
Pragati
Anonymous
6 years agoNot applicable
Thank you very much for your help, Pragati11 !
I copied the measure and it works great. Would the measure need to be change lot, if I also would like to have have a comma (or &) after each selected filter, except the last?
Yellow,
Orange,
Red
By the way, would you recommend any websites or other resources for learning about Power BI or DAX?
Thanks again.
- Pragati116 years ago
Super User
HI Anonymous
Just modify the measure to the following:
new Check = var total = CALCULATE(COUNT(ColorSample[color]), ALL(ColorSample[color])) RETURN IF(HASONEVALUE(ColorSample[color]), SELECTEDVALUE(ColorSample[color]), IF(COUNT(ColorSample[color]) > 1 && COUNT(ColorSample[color]) < total, CONCATENATEX(VALUES(ColorSample[color]), CONCATENATE(ColorSample[color], ","), UNICHAR(10)) , "All Selected"))This will work and give you desired output.I generally use https://docs.microsoft.com/en-us/dax/ to refer to DAX functions in Power BI.Give Kudos and accept as a solution! 🙂Thanks,Pragati