cancel
Showing results for
Did you mean:
Helper I

How to calculate 3 months and 6 months average

Hi, am looking for help to add a 3month and 6 months average to a Defect Detection chart (2020) (pbix attached).

I have also put a excel sheet chart which i want to replicate in the pbix.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution Specialist

Use something like this on Date column.

6 Months Average Measure =
CALCULATE(
SUM('DRE created 2020'[DRE2020]),
DATESINPERIOD('DRE created 2020'[TempColumn],LASTDATE('DRE created 2020'[TempColumn]),-6,MONTH)
)
/
CALCULATE(
DISTINCTCOUNT('DRE created 2020'[TempColumn]),
DATESINPERIOD('DRE created 2020'[TempColumn],LASTDATE('DRE created 2020'[TempColumn]),-6,MONTH)
)

Regards,

Manikumar

2 REPLIES 2
Super User IV

@bunny18 , you can try measure like these with a date table

Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-6,MONTH))
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-6,MONTH))
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Solution Specialist

Use something like this on Date column.

6 Months Average Measure =
CALCULATE(
SUM('DRE created 2020'[DRE2020]),
DATESINPERIOD('DRE created 2020'[TempColumn],LASTDATE('DRE created 2020'[TempColumn]),-6,MONTH)
)
/
CALCULATE(
DISTINCTCOUNT('DRE created 2020'[TempColumn]),
DATESINPERIOD('DRE created 2020'[TempColumn],LASTDATE('DRE created 2020'[TempColumn]),-6,MONTH)
)

Regards,

Manikumar

Announcements

Power Platform Community Conference

Check out the on demand sessions that are available now!

Microsoft Power Platform Communities

Check out the Winners!

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors