Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,everyone!
I need your help! I need to calculate 3-4 values average based on week no.,The week may not be continuous (some of the weeks may not have value):
Case 1: less than 3 values, not calculated.
Case 2: 3 values, 3 values shall be calculated.
Case 3: more than 3 values, only the last 4 values shall be calculated.
For example: one size had value on week2351/2349/2346, that means week is not continuous, it only calculated 3 values. Another example is that Week2352/2351/2350/2349/2348/2347, only calculate the last 4 weeks value.
How could I get the result by DAX? Has anyone got some ideas about it?
Result may like as below:
For any Time Intelligence you must have a proper date dimension Table.
to get weekly average you can use this formula
AVERAGEX(
DATESINPERIOD(
DateDim[Date], StartDate[Datedim[Date]),-7,Day),Measure on which moving average
required)
Proud to be a Super User!
Thanks for your reply!
Because the week is not continuous sometimes, so I need each size the last 3-4 values to calculate average.Some values in continuous 4 weeks, some are in 10 weeks, only 4 weeks had value.The example as mentioned above!