Forum Discussion
Calculation of difference between two rows
- 1 year ago
I think a visual calculation here would be the best approach anyway so I try to solve it immediately using the names in the visual picture you sent
Difference Visual CALC =
VAR MinYear = MINX ( ROWS, [Jahr] )VAR CurrentYear = [Jahr]
RETURNIF (
[Variante] = "Basis" && CurrentYear <> MinYear && ISATLEVEL ( [Jahr] ),[DVE]- CALCULATE ( [DVE], [Jahr] = CurrentYear -1 ),
[DVE] - CALCULATE ( [DVE], [Variante] = "Basis" )
)If you need to reuse this concept you need a regular measure, in that case refer to my previous post to provide some data
If this helped, please consider giving kudos and mark as a solution
mein replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
I think a visual calculation here would be the best approach anyway so I try to solve it immediately using the names in the visual picture you sent
Difference Visual CALC =
VAR MinYear = MINX ( ROWS, [Jahr] )
VAR CurrentYear = [Jahr]
RETURN
IF (
[Variante] = "Basis" && CurrentYear <> MinYear && ISATLEVEL ( [Jahr] ),
[DVE]- CALCULATE ( [DVE], [Jahr] = CurrentYear -1 ),
[DVE] - CALCULATE ( [DVE], [Variante] = "Basis" )
)
If you need to reuse this concept you need a regular measure, in that case refer to my previous post to provide some data
If this helped, please consider giving kudos and mark as a solution
mein replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi, thank you a lot. This worked well applied to a measure.
However, it was a bit more complicated with the field parameter. The only solution I found was this one. There are only 3 values, but its still a bit clumsy...