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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Can you help me create an measure that is independent from the date dimension, although a date related filtered is required in the formula?
My dataset is in a weekly level. We would like to have a yearly average which could be seen as the sum of the stock divided by 52 weeks. I created this formula:
avg_52_weeks =
var weeks_sum = CALCULATE(
SUM('table 1'[inventory_stock_freiv_qty]),
FILTER(dim_date, dim_date[week_age]>=-52),
FILTER(dim_date, dim_date[week_age]<=-1)
)
RETURN DIVIDE(weeks_sum,52)
The problem is that the user can filter the report by using the date dimension (year or week). I want the value of my measure to be fix when he does that. I don't want the average yearly stock to change when the user filtered time.
Example: I want the user to see 7367 even if he filters only week 2024W10, for example.
I think somehow the ALL() function could be used, but I don't know how. Below there is a power bi dummy file.
Thank you so much for your help!
Solved! Go to Solution.
Try this measure. The function ALLSELECTED clears dim_date filter context from within the visual (e.g., matrix rows). I changed the week_iso_yyyyxww field in the visual to use dim_date instead of 'table 1'; use dimension fields in visuals whenever possible.
avg_52_weeks =
var weeks_sum = CALCULATE(
SUM('table 1'[inventory_stock_freiv_qty]),
ALLSELECTED(dim_date),
dim_date[week_age]>=-52,
dim_date[week_age]<=-1
)
RETURN DIVIDE(weeks_sum,52)
Proud to be a Super User!
@DataInsights I just saw that if I use ALL() instead of ALLSELECTED() it works. Thank you so much!!!
Try this measure. The function ALLSELECTED clears dim_date filter context from within the visual (e.g., matrix rows). I changed the week_iso_yyyyxww field in the visual to use dim_date instead of 'table 1'; use dimension fields in visuals whenever possible.
avg_52_weeks =
var weeks_sum = CALCULATE(
SUM('table 1'[inventory_stock_freiv_qty]),
ALLSELECTED(dim_date),
dim_date[week_age]>=-52,
dim_date[week_age]<=-1
)
RETURN DIVIDE(weeks_sum,52)
Proud to be a Super User!
@DataInsights thank you so much for your help!
In the table it works as I wanted. However, the user still could filter the year in the date dimension or the week, and the value would change. I don't want that. I want to fix the average for the date dimension in all visuals. Is it possible?
I only want the value to change if the user filter a specific product, but the date table should have no influence because the 52 weeks average is a fix value...
Thanks again 🙂
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 39 | |
| 33 | |
| 26 |