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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Conditional columns

I have a report im working on and the user wants me to add a contional column that places OVERDUE for any date that isnt the current date.  I was able to create the coulmn, but I was only able to enter a single date.  How can I tell it to change daily so that todays date would be blank and eveything after is OVERDUE?

 

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Create a custom column in Power Query like below.

if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""

7.PNG 

When you refresh the dataset, the column will be changed.

 

Best Regards,

Jay

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@Anonymous , Are you trying to have a calculated column based on the slicer. That is not possible. You can have a measure.

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
Pragati11
Super User
Super User

HI @Anonymous ,

 

I understand very little of what you are trying to achieve.

Can you share some sample data or screesnhots to understand your issue easily?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Here you go I placed teh data in excel.  I removed a lot of the other data elements, but you can see what im trying to do. Basically the file refershes each day.  Uses a column in PBI called  FOLLOW UP DATE this houses dates of the files.  I wanted to build a conditional column to call out all  over due files...files that have dates prior to todays date each day so tomorrow anything marked 7/23 would now have the over due tag.

 

MS PBI.png

Anonymous
Not applicable

Hi @Anonymous ,

 

Create a custom column in Power Query like below.

if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""

7.PNG 

When you refresh the dataset, the column will be changed.

 

Best Regards,

Jay

Anonymous
Not applicable

GM @Anonymous 

 

Im using the code you gave me above and it works to bring back the due and over due.  Im running into an issue now that when the date field im bouncing off is empty it gives me an error in the custom column.

 

I tried removing Errors, but then it takes thoserows out of the data and we still need to see those.  How can I go about adding something telling it if the value is NULL in the date feild say blank or show a blank value in the custom column?

 

Thanks for the help in advance!

Anonymous
Not applicable

I figured if the conditon said if [RESOLVER_FOLLOW_UP_DATE]<Date.From(DateTime.LocalNow()) then "Over Due" else "Not Due" it would put that for a row that may be blank, but it doesnt and shows error for fields with no date.

Anonymous
Not applicable

Thanks this seemed to work, but 1 issue im running into is all the blanks in the query editer are coming back showing NULL, so when I refresh the data it keeps flagging those as errors.  Anything I can add in the code to make blanks blank and not say NULL?

Anonymous
Not applicable

I have files coming in to my report daily, for each file that is not the current date needs to be marked overdue.  Basically anything that is not the current date would be over due.  So today anything 7/22 and prior is over due then tomorrow anyhting 7/23 prior would be flagged and so on.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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