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

datediff

Hi

 

Can i use the expression like this

 

datediff(datecolumn,today'sdate,day)

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: datediff

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.


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

Proud to be a Datanaut!


Moderator v-qiuyu-msft
Moderator

Re: datediff

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.
3 REPLIES 3
Super User
Super User

Re: datediff

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.


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

Proud to be a Datanaut!


Moderator v-qiuyu-msft
Moderator

Re: datediff

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.
Baskar Super Contributor
Super Contributor

Re: datediff

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

 

Note :

 

Start date should be less then end date

Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 6 members 977 guests
Please welcome our newest community members: