Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Previous computation on Dax

Hi guys, just wanna ask on how can I compute from previous which will be based multiple column. See my expected out below and the computation that I did on Excel     Thank you so much!  
  • tamerj1's avatar
    4 years ago

    Anonymous 
    Here is a sample file with the solution https://www.dropbox.com/t/7HLKwsbFecvw2MlK

    Existing = 
    VAR CurrentDate = Data[Month]
    VAR CurrentProgramTable =
        CALCULATETABLE ( Data, ALLEXCEPT ( Data, Data[Program] ) )
    VAR TableOnAndBefore =
        FILTER ( CurrentProgramTable, Data[Month] <= CurrentDate )
    RETURN
        SUMX ( TableOnAndBefore, Data[New] - Data[Removed] )