Forum Discussion
Help with Measure - Daily Average excluding weekends
- 3 years ago
Hi chris886
It is recommended to prepare a calendar table with a WorkingDay column which has 1 for working days and 0 for weekends/holidays. Create a relationship between the original table and the calendar table on Date column. Then you can try the following measure
Avg of Measure X = VAR _lastDate = TODAY () RETURN DIVIDE ( CALCULATE ( [Measure X], DATESINPERIOD ( 'Calendar'[Date], _lastDate, -14, DAY ) ), CALCULATE ( COUNT ( 'Calendar'[Date] ), DATESINPERIOD ( 'Calendar'[Date], _lastDate, -14, DAY ), 'Calendar'[Working Day] = 1 ) )I have created a sample attached at bottom. Hope it helps.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi chris886
It is recommended to prepare a calendar table with a WorkingDay column which has 1 for working days and 0 for weekends/holidays. Create a relationship between the original table and the calendar table on Date column. Then you can try the following measure
Avg of Measure X =
VAR _lastDate =
TODAY ()
RETURN
DIVIDE (
CALCULATE (
[Measure X],
DATESINPERIOD ( 'Calendar'[Date], _lastDate, -14, DAY )
),
CALCULATE (
COUNT ( 'Calendar'[Date] ),
DATESINPERIOD ( 'Calendar'[Date], _lastDate, -14, DAY ),
'Calendar'[Working Day] = 1
)
)
I have created a sample attached at bottom. Hope it helps.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.