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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Card value is blank when multiple selections in a slicer

 
Hello!

I'm wondering if it's possible to add a condition and how would it look like that if multiple selections were made to a slicer it shows a blank for this card?

EURO-Emission classification =
SWITCH (
TRUE();
vehiclesettings_BI_LL[Year] < 1992; "No Year";
vehiclesettings_BI_LL[Year] <= 1997 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 1";
vehiclesettings_BI_LL[Year] <= 1998 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 2";
vehiclesettings_BI_LL[Year] <= 2000 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 3";
vehiclesettings_BI_LL[Year] <= 2005 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 4";
vehiclesettings_BI_LL[Year] <= 2008 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 5";
vehiclesettings_BI_LL[Year] <= 2013 && vehiclesettings_BI_LL[MonthNumber] <= 12; "Euro 5";
"Euro 6")
4 REPLIES 4
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous -

 

Use HASONEVALUE( )

 

IF ( HASONEVALUE ( vehiclesettings_BI_LL[Year] ),

    SWITCH(

     .... ,

    "Euro 6"),

"")   //ELSE

 

Note, this will also show "" if 0 slicer selections are made.

 

Hope this helps

David

Anonymous
Not applicable

I tried using this syntax but it changed all of my Euro values inside the column to Blank and the card also shows Blank as the answer if only one vehicle was selected. Could the problem be that this is a calculated column instead of a measure?

EURO-Emission classification =
IF(HASONEVALUE(vehiclesettings_BI_LL[Year]);

SWITCH (
TRUE();
vehiclesettings_BI_LL[Year] < 1992; "No Year";
vehiclesettings_BI_LL[Year] <= 1997 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 1";
vehiclesettings_BI_LL[Year] <= 1998 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 2";
vehiclesettings_BI_LL[Year] <= 2000 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 3";
vehiclesettings_BI_LL[Year] <= 2005 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 4";
vehiclesettings_BI_LL[Year] <= 2008 && vehiclesettings_BI_LL[MonthNumber] <= 10; "Euro 5";
vehiclesettings_BI_LL[Year] <= 2013 && vehiclesettings_BI_LL[MonthNumber] <= 12; "Euro 5";
vehiclesettings_BI_LL[Year] <= 2014; "Euro 6");
"Blank")

@Anonymous - if you want any value to change with a slicer, it must be a measure. Calculated columns are only refreshed once when the entire dataset is refreshed.

 

If you're still having trouble, please share a copy of your PBIX file with sensitive data scrubbed out.

 

David

Anonymous
Not applicable

I changed my syntax to work in a measure and now it works as intended. Thank you for your help!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.