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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ELSH1978
Regular 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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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