Forum Discussion
ALL() within Summarize()
- 1 year ago
okay so to be honest the issue was with my date table structure. I have a complex structure in order to be able to swith between calendar year and fiscal year and it did not work because I was not referencing the right date table. So all the approaches including mine do work in the simplified scneario.
Hi Trisulara88 - you need to override the current filter on Calendar Week and ensure the calculation includes all weeks.
AvgStoresPerWeek =
AVERAGEX(
SUMMARIZE(
CALCULATETABLE(
FACT_Sales,
ALL(FACT_Sales[Calendar Week]) -- Ignore the Calendar Week filter
),
FACT_Sales[Calendar Week], -- Group by Calendar Week
"StoreCount", DISTINCTCOUNT(FACT_Sales[Store]) -- Count distinct stores
),
[StoreCount] -- Average the store count per week
)
Hope this works in your scenerio