Forum Discussion
Measure calculating difference to previous period
- 8 years ago
Hi akowalski ,
In your DAX formula, Min() and Max() are calculated in a same row context which have only one row every iteration, so the filter result is nothing. The aggregation function like Min(), Max() or Sum() should be calculated in every filter context.
Regards,
Jimmy Tao
I tried to solve the problem by adding a measure calculating difference between max and min year.
Diff = MIN(output_ALL_2018p03[Date2Year]) - MAX(output_ALL_2018p03[Date2Year])
It is calculaing properly, but when i i try to add this variable into DateAdd function or even Switch and compare it to numbers (-1,-2,-3) it is not working at all in Switch and in Dateadd it is showing line of zeros.
CALCULATE(SUM('output_ALL_2018p03'[Penetration %]);DATEADD('output_ALL_2018p03'[Date].[Date]; Diff; YEAR))Hi akowalski ,
In your DAX formula, Min() and Max() are calculated in a same row context which have only one row every iteration, so the filter result is nothing. The aggregation function like Min(), Max() or Sum() should be calculated in every filter context.
Regards,
Jimmy Tao