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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Anonymous
Not applicable

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.  

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.  

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.