Forum Discussion
Narender
7 years agoResolver I
Last year collection amount on filter selection base
Hi All, I want to calculate the amount of last year if there is no selection in year filter.So in this way it will show 2017 year amount. But when I will select any other year like 2015 then it ...
- 7 years ago
Hi Narender,
Please modify above formula to:
Measure 25 = IF ( ISFILTERED ( Dates[Year] ), CALCULATE ( SUM ( TAX_TRANSACTION[TAX_SUB_TRANS.AMOUNT] ), FILTER ( ALL ( TAX_TRANSACTION ), YEAR ( TAX_TRANSACTION[Date] ) = SELECTEDVALUE ( Dates[Year] ) - 1 ) ), CALCULATE ( SUM ( TAX_TRANSACTION[TAX_SUB_TRANS.AMOUNT] ), FILTER ( Dates, YEAR ( Dates[Date] ) = YEAR ( TODAY () ) - 1 ) ) )Best regards,
Yuliana Gu
- 7 years ago
I resolved it by adding month expression with the last year expression in DAX.
Narender
v-yulgu-msft
7 years agoMicrosoft Employee
Hi Narender,
Please modify above formula to:
Measure 25 =
IF (
ISFILTERED ( Dates[Year] ),
CALCULATE (
SUM ( TAX_TRANSACTION[TAX_SUB_TRANS.AMOUNT] ),
FILTER (
ALL ( TAX_TRANSACTION ),
YEAR ( TAX_TRANSACTION[Date] )
= SELECTEDVALUE ( Dates[Year] ) - 1
)
),
CALCULATE (
SUM ( TAX_TRANSACTION[TAX_SUB_TRANS.AMOUNT] ),
FILTER ( Dates, YEAR ( Dates[Date] ) = YEAR ( TODAY () ) - 1 )
)
)
Best regards,
Yuliana Gu