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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
ymirza
Helper II
Helper II

How to get a calculated column of Current, Past Due, Near-Due Date from a column of Due Dates?

I have a Due Date column, and I want a filter that should show "Current", "Past Due", and " Near-Due Date".

When the Actual Due date is near 30 days (or more) from today(), it should show "Near-Due Date"

 

I tried a calculated column, but it only returns "Current" and "Past Due"

 

Assignment Due Status = IF(DATEDIFF('TABLE'[AssignmentDueDate], TODAY(), DAY)<0, "Current", IF(DATEDIFF('TABLE'[AssignmentDueDate], TODAY(), DAY)>=0, "Past Due", IF(DATEDIFF('TABLE'[AssignmentDueDate], TODAY(), DAY)<= 30, "Near Due")))
 
Please help!
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@ymirza 

Set it up this way:

Assignment Due Status = 
var __date = DATEDIFF(TODAY() , 'TABLE'[AssignmentDueDate], DAY) return
SWITCH(
    TRUE(),
    __date > 0 && __date <= 30, "Near Due", 
    __date <= 0, "Past Due",
    "Current"
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@ymirza 

Set it up this way:

Assignment Due Status = 
var __date = DATEDIFF(TODAY() , 'TABLE'[AssignmentDueDate], DAY) return
SWITCH(
    TRUE(),
    __date > 0 && __date <= 30, "Near Due", 
    __date <= 0, "Past Due",
    "Current"
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.