Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX sum with filter

Hi,    I have a dataset which looks like this: I basically need a DAX formula which add's the columns "Order gedaan picking" and "Orders openstaand picking" and filters it for a specific tim...
  • ValtteriN's avatar
    ValtteriN
    3 years ago

    Hi,

    In that case, something like this should do:

    Measure 30 =
    var _cur =
    SUM('Table (24)'[Order gedaan picking])+SUM('Table (24)'[Orders openstaand picking]) //current time's value
    var _prevTime = CALCULATE(MAX('Table (24)'[Time]),ALL('Table (24)'[Time]),'Table (24)'[Time]<MAX('Table (24)'[Time])) //previous time
    var _prev = CALCULATE(SUM('Table (24)'[Order gedaan picking]),ALL('Table (24)'[Time]),'Table (24)'[Time]=_prevTime) + CALCULATE(SUM('Table (24)'[Orders openstaand picking]),ALL('Table (24)'[Time]),'Table (24)'[Time]=_prevTime) //previous time's values
    return
    _cur-_prev