Forum Discussion
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've tried differentes methods, but nothing seems to work.
ex.
- Anonymous6 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 5CALCULATE(MAX('Table'[Value]), FILTER('Table','Table'[Season] = EARLIER('Table'[Season])-5))You can also get your values using MeasuresPrevious 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 5CALCULATE(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)
3 Replies
- AnonymousNot applicable
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 5CALCULATE(MAX('Table'[Value]), FILTER('Table','Table'[Season] = EARLIER('Table'[Season])-5))You can also get your values using MeasuresPrevious 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 5CALCULATE(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)
- LJAdminRegular Visitor
Hi,
thank you very much! It works with the Measure Case.