The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello -
I am trying to create a moving average for docs sent out. I have the Moving Average formula worked out, but instead of including every day in my MA, I want to get the MA of only weekdays (Monday-Friday). How can I do that? Below is my current MA DAX which includes weekends as well.
Thanks!
Ryan
Moving Average = IF(ISBLANK( [Total Docs Sent] ),
BLANK(),
AVERAGEX(
DATESINPERIOD(
Calendar[Date],
LASTDATE(Calendar[Date] ),
-'Moving Average What If'[MA Days], DAY ),
[Total Docs Sent] ) )
Make a calculated column in your date table, either using Date.DayOfWeek in the query editor or WEEKDAY in data view and add filter on the relevant values?
Are you referring to adding the filter into my MA formula, if so, how would I implement that filter in? I have already created my 'Weekday' column into my Calendar table where the weekends (Saturday and Sunday) are days 6 and 7.
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |