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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ELSH1978
Frequent Visitor

How to show the count of days from a specific last event to the date of today?

Hello,

I am keeping a track of days that have an Accidents or Incidents in order to make a dashboard that shows the consucative days from last Accident till the day of today.

I am using Sharepoint list to keep a track of the data.

I am stuck in how to show the consecutive days from the last Accident till the day of today. any idea?

 

ELSH1978_0-1725649043069.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ELSH1978 ,

 

Based on your description, I created these data.

vkaiyuemsft_0-1725851029778.png

 

Create measure.

Days Since Last Accident = 
VAR LastAccidentDate = MAXX(FILTER('Table', 'Table'[TYPE] = "ACCIDENT"), 'Table'[Date])
RETURN
DATEDIFF(LastAccidentDate, TODAY(), DAY)

vkaiyuemsft_1-1725851046773.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @ELSH1978 ,

 

Based on your description, I created these data.

vkaiyuemsft_0-1725851029778.png

 

Create measure.

Days Since Last Accident = 
VAR LastAccidentDate = MAXX(FILTER('Table', 'Table'[TYPE] = "ACCIDENT"), 'Table'[Date])
RETURN
DATEDIFF(LastAccidentDate, TODAY(), DAY)

vkaiyuemsft_1-1725851046773.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Days without accident = TODAY() - MAXX(Filter('Table',[Type]="Accident"),[Date])

Thanks @lbendlin for your reply.

It didn't work this way, it is not showing the count of days since the latest accident till today, the values I got are the following:

ELSH1978_0-1725707246041.png

thanks 

Format it as a number or use INT()

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors