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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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