cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
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).

https://drive.google.com/file/d/1idTTxueLZ4PwfZVSeybambEAJ7BNAmTj/view?usp=sharing

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

 

Could you please help how to achieve it.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution Specialist
Solution Specialist

@bunny18 , 

 

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)
)

 

manikumar34_0-1603194480610.png

 

Regards,

Manikumar

 

View solution in original post

2 REPLIES 2
Super User IV
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
Solution Specialist

@bunny18 , 

 

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)
)

 

manikumar34_0-1603194480610.png

 

Regards,

Manikumar

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

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