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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
miguelHG
Frequent Visitor

Help with this problem

It is a very simple topic, but I can't find the solution, I need to set the days between 2 dates, try "Datediff", but it asks for the dates, but when I write the field, the program does not take it:

 

miguelHG_2-1610656291689.png

 

I also tried to create a measure in another table that pulls the date that I need, but I couldn't, can someone help me? Thanks

 

miguelHG_1-1610656256098.png

 

1 ACCEPTED SOLUTION
EricHulshof
Solution Sage
Solution Sage

Hi @miguelHG 

Are you sure your fields are Date or DateTime fields? I used this formula to test and it works fine:
CalculatedColumn:

Datediff = DATEDIFF('Table'[DocDate],'Table'[DocDueDate],DAY)

And for a measure:

DateDiffMeasure = DATEDIFF(SELECTEDVALUE('Table'[DocDate]),SELECTEDVALUE('Table'[DocDueDate]),DAY)


 Result:

Screenshot_21.png

 

Eric.  


Quality over Quantity


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


View solution in original post

1 REPLY 1
EricHulshof
Solution Sage
Solution Sage

Hi @miguelHG 

Are you sure your fields are Date or DateTime fields? I used this formula to test and it works fine:
CalculatedColumn:

Datediff = DATEDIFF('Table'[DocDate],'Table'[DocDueDate],DAY)

And for a measure:

DateDiffMeasure = DATEDIFF(SELECTEDVALUE('Table'[DocDate]),SELECTEDVALUE('Table'[DocDueDate]),DAY)


 Result:

Screenshot_21.png

 

Eric.  


Quality over Quantity


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


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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