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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Chetanab
Employee
Employee

End of month backlog

Please help me with the below -

I have a history table like below. I want a distinct count of IDs with status=Active. If an ID was active earlier and resolved in a particular month, it should not be counted in the backlog for that month end.

 

Work Item IdCreateDateChangeDateStatusEomonth
11/3/20221/12/2022Active1/31/2022
21/5/20221/13/2022Active1/31/2022
21/5/20222/2/2022Resolved2/28/2022
31/5/20221/5/2022Active1/31/2022
31/5/20222/20/2022Resolved2/28/2022
41/5/20221/5/2022Active1/31/2022
41/5/20222/3/2022Active2/28/2022
41/5/20223/3/2022Resolved3/31/2022

 

expected result

EomonthBacklog
1/31/2022      4
2/28/2022      2
3/31/2022      1

 

Notes - 

As of 1/31/2022 - all 4 IDs were active

as of 2/28/2022 - ID1 & ID4 were active

as of 3/31/2022 - only ID1 was active

 

1 ACCEPTED SOLUTION

I see what you mean. V1 whould have work if it would get a corresponding value of EOM when it is opened and not change (This case wasn't shown in the orginal data you shared). So let's do V2:

 

 

Backlog =
VAR _current_eom =
    MAX ( 'Table'[Eomonth] )
VAR _all =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[CreateDate] <= _current_eom,
        REMOVEFILTERS('Table')
    )
VAR _resolved =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[Eomonth] <= _current_eom,
        'Table'[Status] = "Resolved"
    )
RETURN
    _all - _resolved

 

 

View solution in original post

7 REPLIES 7
Chetanab
Employee
Employee

The above solution does not work if a particular ID has no change date in the month it was created. for example in thhe below table, ID 6 was created in Jan 2022 but first changed in Feb 2022. It should still be counted in Jan backlog because it was active in Jan. 

Work Item IdCreateDateChangeDateEomonthStatus
13-Jan-2212-Jan-2231-Jan-22Active
25-Jan-2213-Jan-2231-Jan-22Active
25-Jan-222-Feb-2228-Feb-22Resolved
35-Jan-225-Jan-2231-Jan-22Active
35-Jan-2220-Feb-2228-Feb-22Resolved
45-Jan-225-Jan-2231-Jan-22Active
45-Jan-223-Feb-2228-Feb-22Active
45-Jan-223-Mar-2231-Mar-22Resolved
55-Jan-225-Jan-2231-Jan-22Active
55-Jan-223-Feb-2228-Feb-22Resolved
55-Jan-223-Mar-2231-Mar-22Resolved
65-Jan-223-Feb-2228-Feb-22Active
65-Jan-223-Mar-2231-Mar-22Resolved

I see what you mean. V1 whould have work if it would get a corresponding value of EOM when it is opened and not change (This case wasn't shown in the orginal data you shared). So let's do V2:

 

 

Backlog =
VAR _current_eom =
    MAX ( 'Table'[Eomonth] )
VAR _all =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[CreateDate] <= _current_eom,
        REMOVEFILTERS('Table')
    )
VAR _resolved =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[Eomonth] <= _current_eom,
        'Table'[Status] = "Resolved"
    )
RETURN
    _all - _resolved

 

 

Thank you 🙂 🙂

Thanks for getting back @SpartaBI . The expected result is 

Chetanab_0-1650659146013.png

where as the above DAX gives

Chetanab_1-1650659171070.png

Please let me know if there is a way to achieve the expected result. Maybe I need a date table? I am also thinking to create another table with create date endofmonth and merging it with this table to use v1

Could you please add:

REMOVEFILTERS('Table') to the first CALCULATE

SpartaBI
Community Champion
Community Champion

Hey @Chetanab ,

Put Eomonth on the rows of a matrix and this measure in the values

Backlog =
VAR _current_eom =
    MAX ( 'Table'[Eomonth] )
VAR _all =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[Eomonth] <= _current_eom
    )
VAR _resolved =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Work Item Id] ),
        'Table'[Eomonth] <= _current_eom,
        'Table'[Status] = "Resolved"
    )
RETURN
    _all - _resolved


 

Awesome. Thank you @SpartaBI 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.