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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BeckyH1324
Frequent Visitor

Power BI Formula Similar to Excel's =IF Statement

I am trying to figure out how to create a column that looks at a date (column "Due date" - see below) and returns a value of "True" if it's past today's date or "False" if it's not. What is the correct way to do this? I'm able to do it in Excel using +IF statement, but can't figure out how to replicate that in Power BI. I am currently using an app that is pulling data from Planner and dumping it into an Excel file. I cannot update the Excel source file the data is being pulled from since it is being overwritten every hour. Any help is greatly appreciated. Thanks!

DueDate.jpg

 

1 ACCEPTED SOLUTION

Hi again,
There are several options how to achieve it. Maybe not the best, but definitelly very easy is to:
1. Create a new custom column "Today"
2. Function for custom column should look like this:

Migasuke_1-1625086131847.png

 

3. Change the data type from Date-Time to only Date
4. Follow the same logic as I  mentioned before, only now you will use for the comparison this dynamic column instead of a date:

Migasuke_2-1625086131710.png

 

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

5 REPLIES 5
Migasuke
Memorable Member
Memorable Member

Hi,

you can also create a conditional column with IF. The easiest way is:
1. Go to Add a new column.
2. Add conditional column.
3. Choose which columns to use for evaluation and what should be the condition and results.

Similar in following picture:

Migasuke_1-1625084435892.png

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

All of that worked fine up until I went to save the conditional column. It's forcing me to pick a DateTime value.

DateError.jpg

 I went back, changed the "Today" column to have the full date and time, then created the Conditional Column and it worked. I was able to change the "Today" column after the condition was set to be date only. 

Thank you so much for your help!

 

Interesting behavior, it did not "force" me to have there Date-time value.

Anyway glad to help and please mark this as a solution so others might find it, when they need it.



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Hi Migasuke,

Thank you for your quick reply. I tried this and it does work as long as designed. I would like the date value to be a dynamic value (ie - whatever today's date may be at any given time). Is it possible to have a formula or something similar in that field so it knows to use today's date rather than just June 30, 2021?

DateValue.jpg

 

Hi again,
There are several options how to achieve it. Maybe not the best, but definitelly very easy is to:
1. Create a new custom column "Today"
2. Function for custom column should look like this:

Migasuke_1-1625086131847.png

 

3. Change the data type from Date-Time to only Date
4. Follow the same logic as I  mentioned before, only now you will use for the comparison this dynamic column instead of a date:

Migasuke_2-1625086131710.png

 

 



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors