How to display multiple selected values on card visual based on slicer selection | Power BI DAX

Recently, while working on one of the projects, I encountered a situation where I needed to display multiple values on a card based on the slicer selection. Additionally, it should display a blank value if no selection is made from the slicer.


Initially, I attempted to use the SELECTEDVALUE function to display the value and to show a blank if no slicer value was selected. I was able to achieve the desired result. However, it failed when multiple values needed to be displayed on the card.


To obtain the required output, we need to use IF, ISFILTERED, CONCATENATEX, and BLANK functions.


```DAX

Example = IF(ISFILTERED('Slicer Column Name'[]),

                  CONCATENATEX('Table Name', 'Column Name'[], " "),

                  BLANK())

```

Where:

- 'Slicer Column Name' is the column used in the slicer.

- 'Column Name' is the column displayed on the card.


Comments