Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bunny18
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
manikumar34
Solution Sage
Solution Sage

@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

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

2 REPLIES 2
manikumar34
Solution Sage
Solution Sage

@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

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




amitchandak
Super User
Super User

@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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.