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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
drrai66
Resolver I
Resolver I

How to get Count of Incidents for last 90 days

Hello Experts,

I have 2 years of Incident data, so Unfortunately I am not able to attach any data or Picture this time, it is too big. The data has column such as Incident number, INcident Type( Auto or User). I can individually calculate the Number of Total  auto Incidents and Total User Incidents  for 2 years. I just need now last 90 days count of Auto and user Incidents. I can't do any filtering in Query Editor, as Initially this data set was for 4 Years and I reduced it to 2 years to do my other calculations. Any Formula or way?

Thanks

Deepak

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @drrai66,

 

Without any data is difficult to give you the rigth answer to your question however you should have something like this:

 

 Last 90 days = 
var Select_Date = MAX(Table[Date])

Return

CALCULATE( COUNT(Table[Incident]);Table[Date] >= Select_Date - 90)

This should work however did not test it out in PBI not on computer right now if you can provide a sample of your data just a simple data mockup would be helpfull.

 

Be aware that for this to work you need to have a date filter on your visuals, however if you want to have it for current date just change it to:

 Last 90 days = 
CALCULATE( COUNT(Table[Incident]);Table[Date] >= TODAY() - 90)

 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @drrai66,

 

Without any data is difficult to give you the rigth answer to your question however you should have something like this:

 

 Last 90 days = 
var Select_Date = MAX(Table[Date])

Return

CALCULATE( COUNT(Table[Incident]);Table[Date] >= Select_Date - 90)

This should work however did not test it out in PBI not on computer right now if you can provide a sample of your data just a simple data mockup would be helpfull.

 

Be aware that for this to work you need to have a date filter on your visuals, however if you want to have it for current date just change it to:

 Last 90 days = 
CALCULATE( COUNT(Table[Incident]);Table[Date] >= TODAY() - 90)

 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi

Sorry for Delay, I applied it and it Worked Perfectly!!!

Thanks

Deepak

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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