cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

today function in M language

getdate() , today() ?

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User I
Super User I

Re: today function in M language

@Usates it looks like there's no problem with the formula itself. It must be somewhere else, probably something to do with that Due Date column. Hit OK and select one of those error cells. What does it say down at the bottom of the screen when you do that?





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Highlighted
Super User I
Super User I

Re: today function in M language

@Usates DateTime.LocalNow()

 

That returns a datetime value, not a simple date, so if you're using it in another formula to compare with other dates, you may need to nest it to strip out the time. Like so:

 

Date.From(DateTime.LocalNow())





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

Proud to be a Super User!




Highlighted
Helper V
Helper V

Re: today function in M language

Trying my hardest to learn DAX and now they throw M Language on top of it?????

 

Anyway, Thank you for your help on this project I'm working on.  Here is my error, do you have any suggestions?

 

Capture.PNG

Highlighted
Super User I
Super User I

Re: today function in M language

@Usates it looks like there's no problem with the formula itself. It must be somewhere else, probably something to do with that Due Date column. Hit OK and select one of those error cells. What does it say down at the bottom of the screen when you do that?





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

Proud to be a Super User!




View solution in original post

Highlighted
Helper V
Helper V

Re: today function in M language

The error was that my Due Date had time in it also so I changed it to:

 

Date.From(DateTime.LocalNow())-Date.From([Due Date])

 

and it worked.

 

Thank You!!

Highlighted
Super User I
Super User I

Re: today function in M language

@Usates if you want to keep the time you could just skip both of the Date.From statements entirely. Or I think you could combine them.

 

Date.From(DateTime.LocalNow() - [Due Date])

 

...should work exactly the same, and might even run a little faster.





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

Proud to be a Super User!




Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors