Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
My data has only weekday, as per given formulas, my moving averages are considering weekends (Sat and Sudays) also as dates. How I skip those in my moving averages? please help.
My formulas:
5dayMovingSum =
CALCULATE(sum(Query1[Inv_Amount]),DATESINPERIOD(Query1[Inv_Date],LASTDATE(Query1[Inv_Date]),-5,day))
5dayMovingSum_Avg = CALCULATE(sum(Query1[Inv_Amount]),DATESINPERIOD(Query1[Inv_Date],LASTDATE(Query1[Inv_Date]),-5,day))/5
My Data screen shot:
Solved! Go to Solution.
You could try LASTDATE(Query1[Inv_Date]),-7,day)
and maybe use the AVERAGEX function for your moving average?
Hi @Murali,
Have you tried the solution provided by Phil_Seamark? As your data only contains weekday, it should work for 5 Day Moving Average in this scenario.![]()
@Phil_Seamark Really brilliant solution! I was trying to add a "WeekDay" column to solve this which seems no necessary.![]()
Regards
You could try LASTDATE(Query1[Inv_Date]),-7,day)
and maybe use the AVERAGEX function for your moving average?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 49 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 66 | |
| 33 | |
| 32 | |
| 32 |