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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Amarnay
Regular Visitor

How do I get a Card to show no data when no option is selected in a filter slicer?

How do I get a Card to show no data when no option is selected in a filter slicer?

1 ACCEPTED SOLUTION
v-tianyich-msft
Community Support
Community Support

Hi @Amarnay ,

 

I made simple samples and you can check the results below:

vtianyichmsft_0-1705888027139.png

vtianyichmsft_1-1705888041689.png

 

Please feel free to correct me and provide more information if I have misunderstood you!

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

5 REPLIES 5
v-tianyich-msft
Community Support
Community Support

Hi @Amarnay ,

 

I made simple samples and you can check the results below:

vtianyichmsft_0-1705888027139.png

vtianyichmsft_1-1705888041689.png

 

Please feel free to correct me and provide more information if I have misunderstood you!

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

lbendlin
Super User
Super User

ISFILTERED works on the data model, not on a visual 

Amarnay
Regular Visitor

ISFILTERED() only works on a table. I am looking for a Card

Hello @Amarnay

 

you can use something like this : 

if we assume you have country as a slicer , and customrename as a second slicer you can use the following measure : 

 

 measure = 

switch(

true(), 

isfiltered ( table_name[country] ) || isfiltered( table_name[customername]) ,  sum(sales) ,

blank() ) 

)

 

the logic is to check with isfiltered if you have any filters in the filter context.

 

 

now the problem with this approach, that everytime you add a slicer, you need to go and modify your measure to take the new slicer into consideration ,

 

so another approach i would suggest (  if your slicers are gettings the data from dimensions and you have a fact table in the middle) , 

so you can use this dax code  : 

 

measure = 

switch(

true(), 

iscrossfiltered ( facttable_name )  ,  sum(sales) ,

blank() ) 

)

hope this helps you out.

 

best regards

 



ressources : 
https://dax.guide/iscrossfiltered/

https://dax.guide/isfiltered/

lbendlin
Super User
Super User

Consider using ISFILTERED(). Note that this will also return FALSE when everything is selected.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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