Forum Discussion
Anonymous
1 year agoNot applicable
Average 4,8 weeks with Data Table contain weekly numbers
Hi Experts, I need to calculate the average 4 weeks and 8 weeks from a table that contains an aggregate weekly values. This table connects to calendar table using column that contains daily dates...
- 1 year ago
Hi,
PBI file attached.
Hope this helps.
rajendraongole1
Super User
1 year agoHi Anonymous - Create a updated DAX measure as below:
Subs_Average_4_Weeks_Run_Rate =
AVERAGEX(
DATESINPERIOD(
'BOM_DIM_Date'[PeriodDate], -- Use the weekly period end date
MAX('BOM_DIM_Date'[PeriodDate]),
-4,
WEEK
),
[Submission_Order_Fixed_5G_Starlink]
)
Using DATESINPERIOD instead of manually filtering by week count is generally more reliable for time-based calculations in Power BI and should give you the correct 4-week average even with weekly aggregated data.
- Anonymous1 year agoNot applicable
Hi Raj - thank you for helping - I copied the DAX :
But it error out for the WEEK part - the Week ending date is just a normal date but only contains the Friday's date for the week.