Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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:
Solved! Go to 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
)
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!
User | Count |
---|---|
98 | |
76 | |
69 | |
53 | |
27 |