Forum Discussion
Depso
2 years agoFrequent Visitor
Substract row to another row on the same column without creating new column
I have a quite interesting request. I have a table like this one: Type Year Price Value1 Value2 Value3 Home 2021 9 2 3 4 Home 2022 27 5 6 7 Home 2023 42 4 5 6...
Greg_Deckler
2 years agoCommunity Champion
Depso Maybe:
var calculatedYear = 'Table'[Year]
var previousYear = calculatedYear - 1
var TypeVal = [Type]
var Value1get= MAXX( FILTER( 'Table','Table'[Year] = calculatedYear && 'Table'[Type]=TypeVal) , [Value1])
var Value2get= MAXX( FILTER( 'Table','Table'[Year] = calculatedYear && 'Table'[Type]=TypeVal) , [Value2])
var Value3get= MAXX( FILTER( 'Table','Table'[Year] = calculatedYear && 'Table'[Type]=TypeVal) , [Value3])
var {YUValue1get= MAXX( FILTER( 'Table','Table'[Year] = previousYear && 'Table'[Type]=TypeVal) , [Value1])
var PYValue2get= MAXX( FILTER( 'Table','Table'[Year] = previousYear && 'Table'[Type]=TypeVal) , [Value2])
var PYValue3get= MAXX( FILTER( 'Table','Table'[Year] = previousYear && 'Table'[Type]=TypeVal) , [Value3])
var Result = Value1get + Value2get + Value3get + PYValue1get + PYValue2get + PYValue3get
Return
ResultDepso
2 years agoFrequent Visitor
This does not work because it only takes into account the previous value and I need it to keep adding up to the original value each time