Forum Discussion
Arthur_NS
4 years agoHelper I
Evolution with condition
Hi all, I have a pretty straightforward table with 3 columns: Year | Number of sales | YOY Basically what I would like to do is calculate the YoY evolution of sales. The only twist is that ...
Samarth_18
4 years agoCommunity Champion
Hi Arthur_NS ,
Please try this:-
measure =
VAR selected_year =
SELECTEDVALUE ( table[year] )
RETURN
CALCULATE (
SUM ( table[number of sales] ),
FILTER ( table, table[year] = selected_year - 1 && table[YOY] = "Yes" )
)
Thanks,
Samarth