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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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