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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Myerstm
Regular Visitor

Add a Custom Column Containing Today's Date

How do I add a custom column which contains a calculated today's date?

1 ACCEPTED SOLUTION
MarkLaf
Solution Sage
Solution Sage

DAX: TODAY()

 

M: DateTime.LocalNow()

 

Note, for M if you want date only you can do Date.From(DateTime.LocalNow())

View solution in original post

5 REPLIES 5
TERRY_HUGHES
Frequent Visitor

Date.From(DateTime.LocalNow())

MarkLaf
Solution Sage
Solution Sage

DAX: TODAY()

 

M: DateTime.LocalNow()

 

Note, for M if you want date only you can do Date.From(DateTime.LocalNow())

When I do this all that turns up in my new Custum Column is "Function" and no dates☹️2022-11-13_10-22-23.jpg

You are actually referencing the function rather than invoking it currently. You could even drill into your column now and see the metadata for the function.

 

To invoke the function, which is what you want, add the parentheses at the end: instead of "each DateTime.LocalNow", use "each DateTime.LocalNow()"

 

 

Hello MarkLaf,

 

Thank you for your help.  I'm a newbie, just getting started and have a long way to go (as you can tell).  M worked perfectly.

 

Tim

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.