Forum Discussion

sraj's avatar
sraj
Icon for Responsive Resident rankResponsive Resident
3 years ago
Solved

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"      
       
    )
  • 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"      
           
        )

     

3 Replies

  • 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"      
           
        )

     

  • sraj's avatar
    sraj
    Icon for Responsive Resident rankResponsive 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?