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
sraj
Responsive Resident
Responsive Resident

Aging bucket

Hi,

 

I have this aging bucket to look at two date range with the following return.  My question is how can I show those accounts that do have an open date but not a close date which needs to show under the overdue bucket. 

 

Aging Bucket =
VAR DaysAge =
    DATEDIFF ( pr_status_dtl[wf_open_dt], pr_status_dtl[wf_close_dt], DAY )
RETURN
    SWITCH (
        TRUE (),
        DaysAge <= 0, "Overdue",
        DaysAge < 15, "Less than 15 days",
        DaysAge <= 30, "15-30 days",
        DaysAge <= 60, "30-60 days", "60 days and above"      
       
    )
1 ACCEPTED SOLUTION
orlandopowerbi
Frequent Visitor

Hi sraj, you only need to add that condition to the measure.

Aging Bucket =
VAR DaysAge =
    DATEDIFF ( pr_status_dtl[wf_open_dt], pr_status_dtl[wf_close_dt], DAY )
RETURN
    SWITCH (
        TRUE (),
        or(ISBLANK(DaysAge),DaysAge <= 0), "Overdue",
        DaysAge < 15"Less than 15 days",
        DaysAge <= 30"15-30 days",
        DaysAge <= 60"30-60 days""60 days and above"      
       
    )

 

View solution in original post

3 REPLIES 3
sraj
Responsive Resident
Responsive Resident

@orlandopowerbi I forgot to mention, there is a possibility of records having an wf_open_dt but missing the WF_CLOSE_DT.  What happens in this scenario?  Will it still go in the OVERDUE bucket?

Correct

orlandopowerbi
Frequent Visitor

Hi sraj, you only need to add that condition to the measure.

Aging Bucket =
VAR DaysAge =
    DATEDIFF ( pr_status_dtl[wf_open_dt], pr_status_dtl[wf_close_dt], DAY )
RETURN
    SWITCH (
        TRUE (),
        or(ISBLANK(DaysAge),DaysAge <= 0), "Overdue",
        DaysAge < 15"Less than 15 days",
        DaysAge <= 30"15-30 days",
        DaysAge <= 60"30-60 days""60 days and above"      
       
    )

 

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.