Rolling Averages In Power BI

Getting a rolling average should be an native function in Power BI. However maybe at the time you read this, there will already be a a feature added. However, in the meantime lets dive into dynamic rolling average using Power BI.

Rolling average in Power BI are easy to create with the calculate function

Here are the list of functions will be using the to create our calculation:

  • SUM
  • CALCULATE
  • LASTDATE
  • DATESINPERIOD
  • DISTINCTCOUNT

There are two points to this formula: 

  1. Calculating the sum of the value in the period 
  2. Calculating the count of days in the period
  3. Dividing these two calculations

Calculating the Sum during the period

CALCULATE(SUM(VALUE), DATESINPERIOD(DATE,START DATE, NUMBER OF INTERVALS, INTERVAL)

Calculating the count of day in the period

CALCULATE(DISTINCTCOUNT(DATE), DATESINPERIOD(DATE,START DATE, NUMBER OF INTERVALS, INTERVAL)

Formula for a 28 day average

28 day rolling average

To make this much cleaner you can use variables that will allow achieve the same affect.

7 day average rolling in Power BI

Dynamic Power BI Rolling Average with DAX Parameters

Gaelim Holland

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ras
Ras
1 month ago

Thank you