cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Calculating 28day Rolling Average for Run Time

Hi,

I used this formula to calculate AVG run-time:

-------------------------------------------------------------------

AVG RunTime(secs) =
AVERAGEX( 'Run Time',
DATEDIFF('Run Time'[StartTime],'Run Time'[EndTime],SECOND)
)
---------------------------------------------------------------------
Key: StartTime and EndTime are a datetime fields
---------------------------------------------------------------------

I want to calculate a rolling 28 day AVG for run-time using a measure with CALCULATE and -28,DAY.
and then I want to drop the measure into a card to show this figure.

Please could I have some help to formulate a measure?
1 ACCEPTED SOLUTION
Super User

@Anonymous , Join start or end date with the date of date table and try (Date without time stamp)

Rolling 28 = CALCULATE(AVERAGEX( 'Run Time',
DATEDIFF('Run Time'[StartTime],'Run Time'[EndTime],SECOND)
),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-28,DAY))

Super User

@Anonymous , Join start or end date with the date of date table and try (Date without time stamp)

Rolling 28 = CALCULATE(AVERAGEX( 'Run Time',
DATEDIFF('Run Time'[StartTime],'Run Time'[EndTime],SECOND)
),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-28,DAY))

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.