Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a situation here where I need to show multiple values selected from multiple sicers in a card visual.
multiple values of same slicer should be seperated by ","and multiple values from multiple slicers should be seperated by "|".
for example, if i select INDIA and USA from country slicer, result is INDIA,USA
if i select INDIA and USA from country slicer and 2021,2022 from year slicer ,result is INDIA,USA |2021,2022
if no value selected from any slicer, result is "not selected"
thanks in advance...
Solved! Go to Solution.
@RAJRANJITHBROS Try @Anonymous's file with this measure instead:
Measure =
VAR Countries = CONCATENATEX ( DISTINCT ( 'Table'[Country] ), [Country], "," )
VAR Years = CONCATENATEX ( DISTINCT ( 'Table 2'[Year] ), [Year], "," )
RETURN
SWITCH (
TRUE(),
ISFILTERED ( 'Table'[Country] ) && ISFILTERED ( 'Table 2'[Year] ), Countries & "|" & Years,
ISFILTERED ( 'Table'[Country] ), Countries,
ISFILTERED ( 'Table 2'[Year] ), Years,
"No selection"
)
Examples:
Hi @RAJRANJITHBROS ,
So far , for Power BI slicer visual, we couldn't get the multiple selected value from slicer, we could only get the single selected value.
For get the single selected value from slicer, please try below steps:
1. below is my test table
Table:
Table2:
2. create a measure with below dax formula
Measure =
VAR cur_country =
SELECTEDVALUE ( 'Table'[Country] )
VAR cur_year =
SELECTEDVALUE ( 'Table 2'[Year] )
VAR _val = cur_country & "|" & cur_year
VAR _a =
HASONEVALUE ( 'Table'[Country] )
VAR _b =
HASONEVALUE ( 'Table 2'[Year] )
RETURN
IF ( _a && _b = TRUE (), _val, "No Selected" )
3. add two slicer with table fields, and add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@RAJRANJITHBROS Try @Anonymous's file with this measure instead:
Measure =
VAR Countries = CONCATENATEX ( DISTINCT ( 'Table'[Country] ), [Country], "," )
VAR Years = CONCATENATEX ( DISTINCT ( 'Table 2'[Year] ), [Year], "," )
RETURN
SWITCH (
TRUE(),
ISFILTERED ( 'Table'[Country] ) && ISFILTERED ( 'Table 2'[Year] ), Countries & "|" & Years,
ISFILTERED ( 'Table'[Country] ), Countries,
ISFILTERED ( 'Table 2'[Year] ), Years,
"No selection"
)
Examples:
Hi,
Hope this helps.
Hi @AlexisOlson ,
Thank you for the correction, I didn't realize the function "concatenatex" had such a function.
Best regards,
Community Support Team_ Binbin Yu
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |