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
Anonymous
Not applicable

Backward calculate backlog

I have the table below in Power BI ("table1") and I need to calculate the values in red working backwards.

calculation for the "known" backlog value for tiday. xOpenCountToday = CALCULATE(count(_Active[ID]),ALL(table1[Date]),'table1'[Date]=TODAY())


I've tried all the various examples on this community board, but just can't get it to work. What is the DAX statement that I should be using (I'm new to dax)? If I was using SQL that I would use lead and lag window functions.

 

Thank you in advance for your time and any assistance you can provide.

 

DateNameIncomingOutgoingBacklog  
10-AprUserA101233  
11-AprUserA4433  
12-AprUserA6237  
13-AprUserA8441  
14-AprUserA3242  
15-AprUserA1439 value=backlog from next day (39) +Outgoing for next day (3) - Incoming for next day (3) = 39
16-AprUserA3339 value=backlog from next day (40) +Outgoing for next day (0) - Incoming for next day (1) = 39
17-AprUserA1040 Value (40) in this is known (see above)
10-AprUserB221257  
11-AprUserB5755  
12-AprUserB2651  
13-AprUserB6552  
14-AprUserB8357  
15-AprUserB2257 value=backlog from next day (59) +Outgoing for next day (1) - Incoming for next day (3) = 57
16-AprUserB3159 value=backlog from next day (60) +Outgoing for next day (0) - Incoming for next day (1) = 59
17-AprUserB1060 Value (60) in this is known (see above)

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as belwo to get it, please find the details in the attachment.

Backlog = 
VAR _seldate =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _selname =
    SELECTEDVALUE ( 'Table'[Name] )
VAR _culincome =
    CALCULATE (
        SUM ( 'Table'[Incoming] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] = _selname
                && 'Table'[Date] > _seldate
        )
    )
VAR _culoutcome =
    CALCULATE (
        SUM ( 'Table'[Outgoing] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] = _selname
                && 'Table'[Date] > _seldate
        )
    )
RETURN
    [xOpenCountToday] + _culoutcome - _culincome

vyiruanmsft_0-1681884180470.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as belwo to get it, please find the details in the attachment.

Backlog = 
VAR _seldate =
    SELECTEDVALUE ( 'Table'[Date] )
VAR _selname =
    SELECTEDVALUE ( 'Table'[Name] )
VAR _culincome =
    CALCULATE (
        SUM ( 'Table'[Incoming] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] = _selname
                && 'Table'[Date] > _seldate
        )
    )
VAR _culoutcome =
    CALCULATE (
        SUM ( 'Table'[Outgoing] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] = _selname
                && 'Table'[Date] > _seldate
        )
    )
RETURN
    [xOpenCountToday] + _culoutcome - _culincome

vyiruanmsft_0-1681884180470.png

Best Regards

Anonymous
Not applicable

Thank you Rena. That appears to be working - Thank you so much 👍

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.