Forum Discussion

kumalasa's avatar
kumalasa
Frequent Visitor
3 years ago
Solved

Create new column with values on previous rows

Hello Threre,   I have a table that consists of the columns below, I would like to have a formula that creates the columns "Socket-InComplete" and "Socket-InNewValue".   Formula View     ...
  • amitchandak's avatar
    3 years ago

    kumalasa , You need to create a cumulative/running total approach. You can use the previous row value which also calculating

     

    example measure using date table

     

    CALCULATE(SUM(Table[Stock In]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Stock Out]),filter(date,date[date] <=maxx(date,date[date])))

     

    Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw