cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

datediff

Hi

 

Can i use the expression like this

 

datediff(datecolumn,today'sdate,day)

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IV
Super User IV

Yes, as long as datecolumn is always less than today (in the past). The format is:

 

Days = DATEDIFF([datecolumn],TODAY(),DAY)

 

This would be for a custom column.

 

If it is not always in the past, you could do it this way:

 

Days = datecolumn = TODAY() * 1.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

Highlighted
Community Support
Community Support

Hi @kishoresakamuri,

 

Of course, you can. The syntax of DATEDIFF() is below:

 

DATEDIFF(<start_date>, <end_date>, <interval>) 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

4 REPLIES 4
Highlighted
Super User IV
Super User IV

Yes, as long as datecolumn is always less than today (in the past). The format is:

 

Days = DATEDIFF([datecolumn],TODAY(),DAY)

 

This would be for a custom column.

 

If it is not always in the past, you could do it this way:

 

Days = datecolumn = TODAY() * 1.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




View solution in original post

Highlighted
Community Support
Community Support

Hi @kishoresakamuri,

 

Of course, you can. The syntax of DATEDIFF() is below:

 

DATEDIFF(<start_date>, <end_date>, <interval>) 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

Highlighted
Resident Rockstar
Resident Rockstar

DATEDIFF(<start_date>, <end_date>, <interval>) 

 

Note :

 

Start date should be less then end date

Highlighted

I have tried multiple times to get the diference between today and start date but always getting error. All i need is just the AGING of the line item.

 

Also, it should be WORKING DAYS. but I could not get beyond this...

 

PI error.png

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors