Forum Discussion

LJAdmin's avatar
LJAdmin
Regular Visitor
6 years ago
Solved

Calculate Previuos Period

Hi all, I'm trying to obtain a table like this:   Season Value Previuos Season 20201 5000 6000 20196 6000       but i can't managed to calculate the Previuos Season.   I'v...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi LJAdmin ,

     

    Created for 2 scenarios.

     

    1. Your season value differs by 5 everytime.

    2. If the above is not the case, you can create an index column .

     

     

    You can get your values by creating Calculated Columns

     

     

    Create a Calculated Column

     

    Previous Value =
    // Incase you have an Index Column
    //CALCULATE(MAX('Table'[Value]), FILTER('Table','Table'[Index Value] > EARLIER('Table'[Index Value])))


    //Incase your Season Value Differs by 5
    CALCULATE(MAX('Table'[Value]), FILTER('Table','Table'[Season] = EARLIER('Table'[Season])-5))
     
     
     
    You can also get your values using Measures
     
     
     
    Previous Value Measure =
    // Incase you have an Index Column
    //CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'), MAX('Table'[Index Value]) = 'Table'[Index Value] - 1 ))


    //Incase your Season Value Differs by 5
    CALCULATE(MAX('Table'[Value]), FILTER(ALL('Table'),MAX('Table'[Season]) = 'Table'[Season]+5))
     
     
     
    Regards,

    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)