cancel
Showing results for
Did you mean:
Helper III

## Calculate the last 90 days average

Hello,

Although using a date slicer would be great, I am trying to capture a specific number using a measure.

What I have so far is a measure that reads the daily average and gives me a usage per minute value. I use usage (divided by 1000) and run time. We can call this DailyAverage. This converts usage to 1000s and hours ran to minutes.

DailyAverage =
Var Usage = SUM(Table[Usage]) * 1000
Var RunTime = SUM(Table[HoursRan]) * 60
Return
DIVIDE(Usage,Runtime)

I have a date column called Table[Date] where I want to calculate the daily readings from the last 90 days and find an average. How would this measure look?

CALCULATE(AVERAGE(Table[DailyAverage]), Date Function I am having trouble with)

1 ACCEPTED SOLUTION
Super User

@water-guy-5 Maybe:

``````Measure =
VAR __Table =
FILTER(Table[Date], [Date] >= TODAY()-90),
"__DailyAverage",[DailyAverage]
)
RETURN
AVERAGEX(__Table, [__DailyAverage])``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Super User

@water-guy-5 Maybe:

``````Measure =
VAR __Table =
FILTER(Table[Date], [Date] >= TODAY()-90),
"__DailyAverage",[DailyAverage]
)
RETURN
AVERAGEX(__Table, [__DailyAverage])``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors