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
topazz11
Helper III
Helper III

Days difference between two dates

I have seen a number of posts about calculating the day count between two date.  None seem to address my specific use case.

I'm stuck with some calculation and I could use some help. 

 

This doesnt work...  Date Dif = DATEDIFF(MAX(A[Finish].[Date]),MAX(A[Goal Date].[Date]),DAY)
 

Belos is what I am trying to get;

Del.JPG

 

Thanks,

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi , @topazz11 

As mentioned  by  @MattAllington   @amitchandak 
Create calculate column :

 

Date Dif = VALUE(A[Finish]) - VALUE(A[Goal Date])

 

Or create measure :

 

Date Dif2 = DATEDIFF(MAX(A[Goal Date]),MAX(A[Finish]),DAY)

 

It shows as below:

63.png

 

Here  is a  demo .

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi , @topazz11 

As mentioned  by  @MattAllington   @amitchandak 
Create calculate column :

 

Date Dif = VALUE(A[Finish]) - VALUE(A[Goal Date])

 

Or create measure :

 

Date Dif2 = DATEDIFF(MAX(A[Goal Date]),MAX(A[Finish]),DAY)

 

It shows as below:

63.png

 

Here  is a  demo .

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

If the date is in the same table

Date Dif = DATEDIFF(MAX(A[Finish]),MAX(A[Goal Date]),DAY)

 

Also please refer this pbix

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

 

It has datediff, within table across table

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

I think it doesn't need to be that complex. Assuming you are writing a column, try this. 

Date Dif = value(A[Finish] - A[Goal Date])

 
PS. Don't call your table A



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.