Forum Discussion

bklyn3's avatar
bklyn3
Advocate II
4 years ago
Solved

Using DAX for a running sum based on dates

Hello  I have a table with OrderID, Order_Date and Ship_Date.  I am trying to add a column with the number of Open order (i.e. ordered but not yet ship) at the day a new order is placed.  That i...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, bklyn3 ;

    You could create a measure,

    Measure = CALCULATE(COUNT('Table'[OrderID]),FILTER(ALL('Table'),[Order_Date ]<=MAX('Table'[Order_Date ])&&[Ship_Date]>MAX('Table'[Order_Date ])))

    The final output is shown below:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.