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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.