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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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