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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

today function in M language

getdate() , today() ?

Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 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?

View solution in original post

6 REPLIES 6
JulioGadioli
Frequent Visitor

Good, work, try too: (M language | Power Query)

Duration.Days(Date.From(DateTime.LocalNow())-Date.From([MinDueDate]))

Anonymous
Not applicable

@Anonymous 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())

Anonymous
Not applicable

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

Anonymous
Not applicable

@Anonymous 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?

Anonymous
Not applicable

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!!

Anonymous
Not applicable

@Anonymous 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.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.