cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
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.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 344 members 3,675 guests
Please welcome our newest community members: