Forum Discussion
Avoid skipping empty rows when SUMMARIZE table with zero records in the source
- 2 years ago
I would start with a full set of weeks and then calculate amount along these lines:
Average weekly business won volume = VAR _FullWeeks_ = VALUES ( Calendar[Week number] ) VAR _Avg = AVERAGEX ( _FullWeeks_, CALCULATE ( SUM ( BusinessCases[Ammount] ), BusinessCases[Status] = "Won", BusinessCases[Date type] = "Closed" ) + 0 ) RETURN _AvgYou might need something more sophisticated for _FullWeeks_ as I'm not sure how the min and max week numbers are determined in your scenario.
Average weekly business won volume =
AVERAGEX (
VALUES ( Calendar[Week number] ),
CALCULATE (
SUM ( BusinessCases[Ammount] ),
FILTER (
BusinessCases,
BusinessCases[Status] = "Won"
&& BusinessCases[Date type] = "Closed"
)
) + 0
)
Hello tamerj1 , thank you very much for the update. We are pretty close - for every single week the calculation works as expected (incl. 0 values instead of skipped rows) but the final average return the sum of the weekly values instead of average values.
But modificated solution provided by AlexisOlson bellow (ommited FILTER function) works perpectly.
Thank you very much to both of you!