Forum Discussion

Powerwoman's avatar
Powerwoman
Icon for Helper II rankHelper II
2 years ago
Solved

Running Total not working in calculated column

Hi there,

can anyone tell me, why this DAX isn't working but always showing the total instead of running total?
Running totals should be calculated by item.

remainingNew =
 CALCULATE(
    sum(itemLedgerEntryPurchase[amount])
    , ALLEXCEPT(itemLedgerEntryPurchase,itemLedgerEntryPurchase[item])
    ,itemLedgerEntryPurchase[Index] <= MAX(itemLedgerEntryPurchase[Index]
))
 

 

Thanx!

 

  •  

    remainingNew =
    VAR __idx = itemLedgerEntryPurchase[Index]
    RETURN
        CALCULATE(
            SUM( itemLedgerEntryPurchase[amount] ),
            ALLEXCEPT( itemLedgerEntryPurchase, itemLedgerEntryPurchase[item] ),
            itemLedgerEntryPurchase[Index] <= __idx
        )

2 Replies

  •  

    remainingNew =
    VAR __idx = itemLedgerEntryPurchase[Index]
    RETURN
        CALCULATE(
            SUM( itemLedgerEntryPurchase[amount] ),
            ALLEXCEPT( itemLedgerEntryPurchase, itemLedgerEntryPurchase[item] ),
            itemLedgerEntryPurchase[Index] <= __idx
        )
  • You can try the following dax measure

    Running Total =

    SUMX(

    FILTER(

    ALL(YourTable),

    YourTable[Index] <= MAX(YourTable[Index]) ),

    YourTable[ValueColumn]

    )