Forum Discussion

bmacman's avatar
bmacman
Frequent Visitor
3 years ago
Solved

Subtracting a column value on one date from the previous data date for a specific device

HI I Have a problem I am trying to figure out.  I am fairly new to Power BI. I want to add a column that  takes the value of the SMU for a machine name and calculates the difference between it and...
  • amitchandak's avatar
    3 years ago

    bmacman , a new column

    new column =

    var _max = maxx(filter(Table, [Machine name] = earlier([Machine name]) && [ShiftDateTime] < earlier([ShiftDateTime] ) ),[ShiftDateTime] )

    return

    [SMU] - maxx(filter(Table, [Machine name] = earlier([Machine name]) && [ShiftDateTime] =_max ),[SMU] ) 

     

     

    Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8