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
_jaime_
Frequent Visitor

If the date is less than today with NULL

Hi all!

I am total new here.

 

I have the date data as below:
Power bi question.PNG

 

 

 

 

 

 

 

 

 

 

 



I want to add a custom column

 

If the IEP Apporved Forecast/Actual is less than today then "yes" else "no" (include NULL).

 

I've tried 

IF([#"IEP Approved Forecast/Actual"] <= TODAY(),"yes","no"), and error message showed up.

Capture.PNG

 

How can I do this?

Thanks in advance! 🙂

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi

I believe the following should work in power query:

MyColumn =
if [IEP Approved Forecast/Actual] <= Date.From(DateTime.LocalNow())
then "yes"
else "no"

Pete


Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

7 REPLIES 7
Ciotti
Frequent Visitor

Hi, 

 

I have tried the above but it is returning error because I have missing dates in a date column displaying as null. Other dates work as expected. 

is there a way to include null or do I need to create a new column and replacing the nulls?

 

Thanks 

Hi @Ciotti ,

 

You can just add another condition into to IF statement, something like this:

if [YourColumn] = null then null
else if [YourColumn] <= Date.From(DateTime.LocalNow()) then "yes"
else "no"

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi

I believe the following should work in power query:

MyColumn =
if [IEP Approved Forecast/Actual] <= Date.From(DateTime.LocalNow())
then "yes"
else "no"

Pete


Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




I did the query as below, and it worked! Thank you very much! 🙂

 

MyColumn =

If [#"IEP Approved Forecast/Actual"] <= Date.From(DateTime.LocalNow())
then "yes"
else "no"

amitchandak
Super User
Super User

Are you doing in edit Query mode as a custom column or create a new column outside edit query.

 

For power query refer

https://community.powerbi.com/t5/Desktop/IF-Statement-using-Power-Query/td-p/122030

I think it should be like

IF([#IEP Approved Forecast/Actual] <= TODAY(),"yes","no"),

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I am doing in power query editer mode. Thank you!

Did this solve the issue?
Please mark as the solution if it did.

Thanks


Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.