Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Hide visual with IF ISFILTERED and SELECTEDVALUE by using a multiple slicer selection

I have 3 matrix with KPIs (rows) and a slicer with month.

I want to hide the KPI in the third matrix with a card (white background and text "data available as from February") IF the selected month is before February. (because data are only available after February)

We can select multiple month in the slicer.

Fiscal Year is starting on October.

hide if isfiltered and selectedvalue.JPG

If I select only october or only november for example -> it´s working and KPIs are hidden by the card (see screenshot).

But my problem is when I select multiple month (october + november), it´s not working anymore.

Moreover I want it to disappear if Febuary (or month after) is selected: so for example December+January+February

 

I tried different ways but combinations are not working (not reacting).

Message for the card:

IF(
ISFILTERED(Kalender[Monatname]) && SELECTEDVALUE(Kalender[Monatname]) IN {"Oktober", "November", "Dezember", "Januar"}
|| SELECTEDVALUE(Kalender[Monatname]) IN {"Oktober", "November"}
|| SELECTEDVALUE(Kalender[Monatname]) IN {"Oktober", "November", "Dezember"}
|| SELECTEDVALUE(Kalender[Monatname]) IN {"November", "Dezember"}
|| SELECTEDVALUE(Kalender[Monatname]) IN {"November", "Dezember", "Januar"}
|| SELECTEDVALUE(Kalender[Monatname]) IN {"Dezember", "Januar"}
,"Daten ab Februar 2022 vorhanden",
"")
 
White Background for the card: (here another way with number of month instead of name but also not working on multiple selection)
IF(
ISFILTERED(Kalender[Monatname]) && SELECTEDVALUE(Kalender[Monat]) IN {10,11,12,1}
|| SELECTEDVALUE(Kalender[Monatname]) IN {10,11}
|| SELECTEDVALUE(Kalender[Monatname]) IN {10,11,12}
|| SELECTEDVALUE(Kalender[Monatname]) IN {11,12}
|| SELECTEDVALUE(Kalender[Monatname]) IN {11,12,1}
|| SELECTEDVALUE(Kalender[Monatname]) IN {12,1}
, "White"
,"#FFFFFF00")
 
I also tried with 
IF(
ISFILTERED(Kalender[Monatname]) && SELECTEDVALUE(Kalender[Monatname]) = "October"
|| SELECTEDVALUE(Kalender[Monatname]) = "November"
 
but it is not working with combination of month.
 
Any ideas on how to write the correct DAX code to get reaction on multiple month selection (before and after February)
 
Thanks a lot!
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Your measure doesn't work because of the SELECTEDVALUE function. It returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult. So when selecting multiple months, it returns the default blank value rather than the selected months. 

 

To resolve this problem, you can use MAX instead of SELECTEDVALUE. You can add a fiscal month number column to the calendar table which starts at 1 in October and ends at 12 in September. Then the measures could be simpler. 

Word Measure = IF(MAX('Calendar'[Fiscal Month Numer])<5,"Daten ab Februar 2022 vorhanden","")
Card Color = IF(MAX('Calendar'[Fiscal Month Numer])<5,"White","#FFFFFF00")

 

Result: (I enable the border of the card to make it visible. Sample file has been attached at bottom.)

vjingzhang_0-1656054197227.png

vjingzhang_1-1656054229337.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Your measure doesn't work because of the SELECTEDVALUE function. It returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult. So when selecting multiple months, it returns the default blank value rather than the selected months. 

 

To resolve this problem, you can use MAX instead of SELECTEDVALUE. You can add a fiscal month number column to the calendar table which starts at 1 in October and ends at 12 in September. Then the measures could be simpler. 

Word Measure = IF(MAX('Calendar'[Fiscal Month Numer])<5,"Daten ab Februar 2022 vorhanden","")
Card Color = IF(MAX('Calendar'[Fiscal Month Numer])<5,"White","#FFFFFF00")

 

Result: (I enable the border of the card to make it visible. Sample file has been attached at bottom.)

vjingzhang_0-1656054197227.png

vjingzhang_1-1656054229337.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Hi v-jingzhang,

 

it works! thanks a lot for helping me

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.