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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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