Forum Discussion

Pmorg-73's avatar
Pmorg-73
Icon for Helper I rankHelper I
2 years ago
Solved

adding running total to a single balance value table

This would be easy in Excel. And I have not been using PBI for the last year so a bit rusty, but had previously used it quite a bit.

 

I have a table of credit card transactions with dates

 

I have then got a single row table with a balance $#### on 04/05/2022

 

What is the best approach for making a new running total that takes the original balance and goes to the other table of transactions and adding/subtracting the transactions?

 

I do already have a sum[transactions] measure

and also a RT transactions measure

 

Credit Card RT =
VAR _Lastdate = max('01_Calendar'[Date] )
VAR _firstdate = MIN('01_Calendar'[Date])
VAR _Lastdatewithinvoice = CALCULATE(
    MAX('Credit Card Transactions'[Transaction Date]  ),
    REMOVEFILTERS()
)
VAR Result =
    IF(_firstdate <= _Lastdatewithinvoice,
    CALCULATE(
        [Sum Credit Card],
            '01_Calendar'[Date] <= _Lastdate,
            REMOVEFILTERS('01_Calendar'[Date])
            )
        )
return
Result

 

 

 

3 Replies