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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ShahidYumeen
Helper I
Helper I

filtering card visuals on date without having date field directly in the visual

Hi all,
I have this calculation.

DateFilterCheck =
IF(
ISFILTERED('public device_data_daily'[date]) && NOT(ISBLANK(MIN('public device_data_daily'[date]))),
1,
BLANK()
)
and have this calc applied to the visuals filters as DateFilterCheck = 1.
I want to apply it to the visuals (cards & pie charts) in which the date field isnt directly used. Right now i cant use this in the filtering pane of those visuals. Any idea if i could do this in PowerBI?

Thanks
1 ACCEPTED SOLUTION
FarhanJeelani
Super User
Super User

Hi @ShahidYumeen ,

To apply filtering to visuals in Power BI (like cards or pie charts) without directly using the date field, you can follow this approach:

Problem Breakdown
- Current Approach: You created a calculated column or measure (`DateFilterCheck`) that checks if a date is filtered, and you want to use it as a filter in visuals that don't directly include the date field.
- Issue: Power BI's filtering pane may not allow you to directly apply this measure to visuals that don't inherently include the related data.

Solution

Use measures and the filter pane strategically. Here’s how:

 

1. Create a Measure for Filtering
Instead of a calculated column, use a measure for dynamic filtering:
DAX

DateFilterCheck =
IF(
ISFILTERED('public device_data_daily'[date]) && NOT(ISBLANK(MIN('public device_data_daily'[date]))),
1,
0
)

 

2. Apply the Measure in Visuals
Now you can apply this measure in different ways depending on your requirements:

1. Card Visuals:
- Create another measure that dynamically calculates the card’s value only if `DateFilterCheck` is 1:
DAX

DynamicCardValue =
IF(
[DateFilterCheck] = 1,
CALCULATE(SUM('public device_data_daily'[ValueColumn])), -- Replace `ValueColumn` with the actual field you want to display
BLANK()
)


- Add this measure to your card visual. The card will now show a value only if the date is filtered.

 

2. Pie Charts or Other Aggregated Visuals:
- Apply the same logic to ensure the aggregation respects the filter:

DAX
FilteredPieValue =
IF(
[DateFilterCheck] = 1,
CALCULATE(SUM('public device_data_daily'[ValueColumn])), -- Replace `ValueColumn` with the relevant field
BLANK()
)

- Use this measure in your pie chart or aggregated visual.

 

3. Filter Pane Workaround
If you want to force the filter globally across visuals:
- Add `DateFilterCheck` as a filter to the filter pane at the page level or visual level.
- Set the filter condition to `DateFilterCheck = 1`.

 

4. Alternative with Relationships
If your visual uses data from a different table than the one containing the date field:
- Ensure there is a proper relationship between the date table (`public device_data_daily`) and the table used in your visuals.
- Apply the `DateFilterCheck` logic via measures in the related table.

 

Key Considerations
- Performance Impact: Measures with dynamic filtering like this can be slightly slower, especially with large datasets. Optimize by reducing unnecessary calculations.
- Cross-filtering Behavior: Ensure your relationships and model are set up to propagate filters correctly (e.g., single-directional or bidirectional relationships as needed).

This approach ensures that visuals without a direct date field can still respect the date filter applied to the report or page. Let me know if you need further clarification!

 

Please mark this as solution if it helps. Appreciate Kudos.

View solution in original post

1 REPLY 1
FarhanJeelani
Super User
Super User

Hi @ShahidYumeen ,

To apply filtering to visuals in Power BI (like cards or pie charts) without directly using the date field, you can follow this approach:

Problem Breakdown
- Current Approach: You created a calculated column or measure (`DateFilterCheck`) that checks if a date is filtered, and you want to use it as a filter in visuals that don't directly include the date field.
- Issue: Power BI's filtering pane may not allow you to directly apply this measure to visuals that don't inherently include the related data.

Solution

Use measures and the filter pane strategically. Here’s how:

 

1. Create a Measure for Filtering
Instead of a calculated column, use a measure for dynamic filtering:
DAX

DateFilterCheck =
IF(
ISFILTERED('public device_data_daily'[date]) && NOT(ISBLANK(MIN('public device_data_daily'[date]))),
1,
0
)

 

2. Apply the Measure in Visuals
Now you can apply this measure in different ways depending on your requirements:

1. Card Visuals:
- Create another measure that dynamically calculates the card’s value only if `DateFilterCheck` is 1:
DAX

DynamicCardValue =
IF(
[DateFilterCheck] = 1,
CALCULATE(SUM('public device_data_daily'[ValueColumn])), -- Replace `ValueColumn` with the actual field you want to display
BLANK()
)


- Add this measure to your card visual. The card will now show a value only if the date is filtered.

 

2. Pie Charts or Other Aggregated Visuals:
- Apply the same logic to ensure the aggregation respects the filter:

DAX
FilteredPieValue =
IF(
[DateFilterCheck] = 1,
CALCULATE(SUM('public device_data_daily'[ValueColumn])), -- Replace `ValueColumn` with the relevant field
BLANK()
)

- Use this measure in your pie chart or aggregated visual.

 

3. Filter Pane Workaround
If you want to force the filter globally across visuals:
- Add `DateFilterCheck` as a filter to the filter pane at the page level or visual level.
- Set the filter condition to `DateFilterCheck = 1`.

 

4. Alternative with Relationships
If your visual uses data from a different table than the one containing the date field:
- Ensure there is a proper relationship between the date table (`public device_data_daily`) and the table used in your visuals.
- Apply the `DateFilterCheck` logic via measures in the related table.

 

Key Considerations
- Performance Impact: Measures with dynamic filtering like this can be slightly slower, especially with large datasets. Optimize by reducing unnecessary calculations.
- Cross-filtering Behavior: Ensure your relationships and model are set up to propagate filters correctly (e.g., single-directional or bidirectional relationships as needed).

This approach ensures that visuals without a direct date field can still respect the date filter applied to the report or page. Let me know if you need further clarification!

 

Please mark this as solution if it helps. Appreciate Kudos.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors