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
Vizard
Frequent Visitor

Creating a measure with a filter that ignores other filters on the visual?

The visual is filtered to only show the current season and the previous season, but I want to add a line showing the average of the previous five seasons. We have a flag variable in the table indicating the past five seasons with values of either "yes" or "no". 

 

When I use the following DAX measure, only the past season is brought in for calculation due to the filter on the visual hiding previous seasons:

AVG_FLU = CALCULATE(AVERAGE(Table[count]), FILTER(Table, Table[season_avg5]="yes"))
 
I have tried using the ALL() and REMOVEFILTERS() functionss but the visual filter still applies no matter what I try. Is it possible to include a filter for calculation while also ignoring other filters on the visual?
1 ACCEPTED SOLUTION

AVG_FLU =
CALCULATE(
AVERAGE(Table[count]),
FILTER(
ALL(Table), // Removes all filters from the table
Table[season_avg5] = "yes" // Apply the filter for past 5 seasons
)
)

 

or

 

AVG_FLU =
CALCULATE(
AVERAGE(Table[count]),
REMOVEFILTERS(Table[season]), // Removes the visual filter on the season
KEEPFILTERS(Table[season_avg5] = "yes") // Retains only the filter for the past five seasons
)

View solution in original post

4 REPLIES 4
Shravan133
Super User
Super User

try this:

AVG_FLU =
CALCULATE(
AVERAGE(Table[count]),
FILTER(
ALL(Table[season]), // Ignore any filter on the "season" column
Table[season_avg5] = "yes" 
)
)

I get an error saying "A single value for column 'season_avg5' in table 'FLU' cannot be determined"

AVG_FLU =
CALCULATE(
AVERAGE(Table[count]),
FILTER(
ALL(Table), // Removes all filters from the table
Table[season_avg5] = "yes" // Apply the filter for past 5 seasons
)
)

 

or

 

AVG_FLU =
CALCULATE(
AVERAGE(Table[count]),
REMOVEFILTERS(Table[season]), // Removes the visual filter on the season
KEEPFILTERS(Table[season_avg5] = "yes") // Retains only the filter for the past five seasons
)

The first option resulted in a flat line but the second solution worked. Thank you!

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