Forum Discussion
AlexandruP
2 years agoFrequent Visitor
SUM by LAST YEAR VALUE VALUE
Hello, So I have a dimension for my products which is SeasonCode. For example I have SS23, SS22, etc. But each season the SeasonCode changes so we had specific products part of SS22 collection an...
Igna
Resolver III
2 years agoHello,
Try this :
Sales for Previous Season =
VAR SelectedSeason = SELECTEDVALUE('YourTable'[SeasonCode])
VAR PreviousSeason =
IF (
LEFT(SelectedSeason, 2) = "SS",
"SS" & (VALUE(RIGHT(SelectedSeason, 2)) - 1)
)
RETURN
CALCULATE(
[Total Sales],
FILTER('YourTable', 'YourTable'[SeasonCode] = PreviousSeason)
)
Hope it helps
Igna