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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors