Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Subtracting Not Working as Expected

Hello -   I am working on subtracting Current Data with Past Data using a unique ID to find the last historic value for each unique item. I have successfully calculated the previous value by using ...
  • amitchandak's avatar
    4 years ago

    Anonymous ,a new column, you can use index in place of date

     

    Diff Previous Data =
    var _max = maxx(filter( 'Table','Table'[UID] = EARLIEST('Table'[UID]) , 'Table'[Date] < EARLIER('Table'[Date])),[Date])
    return
    if(isblank(_max) , 0 , [Current Data] -maxx(filter( 'Table','Table'[UID] = EARLIEST('Table'[UID]) , 'Table'[Date] =_max),[Current Data] ) )