Forum Discussion
Dynamic running Total
- 1 year ago
Thanks for the clarification. To achieve a running total by invoice number that dynamically adjusts based on the aging buckets and always appears as the last column, you can use a DAX measure like this:
Running Total AR = VAR CurrentCustomer = SELECTEDVALUE('AR Table'[Customer Number]) VAR CurrentInvoice = SELECTEDVALUE('AR Table'[Invoice Number]) RETURN CALCULATE( SUM('AR Table'[AR Balance]), FILTER( ALLSELECTED('AR Table'), 'AR Table'[Customer Number] = CurrentCustomer && 'AR Table'[Invoice Number] <= CurrentInvoice ) )
This measure calculates a cumulative total of AR Balance per customer ordered by invoice number and respects your matrix’s current filter context, including dynamic aging buckets.When you add this measure to your matrix, it will automatically appear as the last column after the aging buckets, even if the number of aging buckets varies per customer.
If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
Hello Zzzzzzz
use this measure
Running Total AR Balance =
VAR CurrentCustomer = MAX('Table'[Customer Number])
VAR CurrentInvoiceDate = MAX('Table'[Invoice Date])
VAR CurrentInvoiceNumber = MAX('Table'[Invoice Number])
RETURN
CALCULATE(
[AR Balance],
FILTER(
ALLSELECTED('Table'),
'Table'[Customer Number] = CurrentCustomer &&
(
'Table'[Invoice Date] < CurrentInvoiceDate ||
(
'Table'[Invoice Date] = CurrentInvoiceDate &&
'Table'[Invoice Number] <= CurrentInvoiceNumber
)
)
)
)
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
- Zzzzzzz1 year agoFrequent Visitor
i dont understand in my columns section i have this formula there is no running total here how will your mesuare add a running total
Aging Bucket = SWITCH(TRUE(),'ardet'[LINE BALANCE] < 0, "- 0 Days (cred)",[Days Overdue] < 0, "Not Due",[Days Overdue] <= 30, "0-30 Days",[Days Overdue] <= 60, "31-60 Days",[Days Overdue] <= 90, "61-90 Days",[Days Overdue] <= 120, "91-120 Days","Over 120 Days") and don't forget depending on how old the customer invoice dates are that happens on what column of the aging bucket it shows but i want the running total to always show at the end