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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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