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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Lucylangers
New Member

Looking to return todays date in an if formula

Hi all, 

New to PowerBI but long time excel user - I am trying to create a custom column that returns todays date if the value in another column in null, and if not, returning a different date. The whole formula is working except for the todays date function (where I instead change this to a text return the whole thing works). I've tried representing it in multiple ways but to no success . Below is the current formula in PowerBI with the returning error. 

 

Lucylangers_0-1662542974535.png

Lucylangers_1-1662542990136.png

Any help would be really appreciated!!

 

Many thanks,

 

Lucy

 

 

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @Lucylangers 
Please replace TODAY ( ) with DateTime.LocalNow()

View solution in original post

Lucylangers
New Member

Thank you so much, I had tried to use datetime.localnow before but failed to realise I needed the () after! This works perfectly now. 

View solution in original post

3 REPLIES 3
Lucylangers
New Member

Thank you so much, I had tried to use datetime.localnow before but failed to realise I needed the () after! This works perfectly now. 

tamerj1
Super User
Super User

Hi @Lucylangers 
Please replace TODAY ( ) with DateTime.LocalNow()

Talib5651424
New Member

#if you need a date use Date.From()
Date.From(DateTime.LocalNow())

You should use this instad of TODAY()

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.