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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

How to count amount of days between 2 dates

Hey all,

 

I have a table like this

Date occuredDate Reported
1/1/202/1/20
3/2/203/2/20
5/7/2015/7/20

 

How would I write DAX to count the days from occured to reported and then provide the average. Also counting same day reported as "1" not "0".

 

Thanks,

J

1 ACCEPTED SOLUTION

@Anonymous , Check this file, on 2nd page there is visual having working day diff

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

 

Just make sure weekday is taken correctly

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You can create a new column like

New column =datediff([Date occured],[Date Reported],Day)+1

 

And take Average of this

Anonymous
Not applicable

@amitchandak 

 

Thanks that worked great! Is there a way to also count only Mon - Fri?

 

J

@Anonymous , Check this file, on 2nd page there is visual having working day diff

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

 

Just make sure weekday is taken correctly

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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