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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ShahidYumeen
Helper I
Helper I

FIltering works differently on cards

Hi,

I am using this dax 

DateFilterCheck =
IF(
ISFILTERED('public device_data_daily'[date]) && NOT(ISBLANK(MIN('public device_data_daily'[date]))),
1,
BLANK()
)
I have applied it on my visuals in the filter pane and set it to DAteFilterChack = 1. It works fine on all the other visuals except the cards and two pie charts. I dont understand why. The filters applied on these visuals are same as the others yet this field is behaving differently for different visuals. Any help would be appreciated 🙂
Thanks
5 REPLIES 5
v-zhouwen-msft
Community Support
Community Support

Hi all,Thanks for your quick response, I'll add more.

Hi @ShahidYumeen ,

Regarding your question, the card has no filter context by default. So the judgment of your DAX in this part is always false.

ISFILTERED('public device_data_daily'[date]) 

Put '[date]' here to filter. If you still have questions, please further explain your needs and provide simple data.

vzhouwenmsft_0-1732070310045.png

 

Best wishes,

Zhou Wenbin

 

johnt75
Super User
Super User

If you are including the date in the other visuals that would explain why it is behaving differently. When the date is in a table / matrix row, or on a chart axis, that applies a filter so ISFILTERED would return true.

MFelix
Super User
Super User

Hi @ShahidYumeen ,

 

This is  dependent of the filter context that is being applied. How is the Date column being used on the other visuals do you have that column on the visuals or are you using a slicer or the filter pnae to get the values?

 

The card visualizations only have a single value so if you do not have the Data has part of your context (slicer or filter) then the calculation is based on the overall value of the date son this will always return 1 and the value is correct. The same thing can happened for your pie chart that you are not using the date has part of the context of the visual.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Yeah that is the case i am not using date field directly in these visuals but i want this calc to work because when i pick a date from a slicer these visuals also get filtered so how could i make this calc applicale to these visuals too having date field not directly in them?

 

Try to replace the IF by a countrows:

CALCULATE(COUNTROWS('public device_data_daily'[),
ISFILTERED('public device_data_daily'[date]) && NOT(ISBLANK(MIN('public device_data_daily'[date]))),
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors