Forum Discussion
gvg
5 years agoPost Prodigy
Measure does not work when applied as calculated column formula
Hi, I have a simple table : I need to add a column that contains sales of the previous year. I can easily calculate it with a measure like this: Amount previous year =
CALCULATE( sum ( ...
- 5 years ago
gvg try this for calculated column
Prev Year = VAR __prevYear = Sales[Year] - 1 RETURN CALCULATE ( SUM ( Sales[Amount] ), ALL ( Sales ), Sales[Year] = __prevYear )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
gvg
5 years agoPost Prodigy
Yep, that works. Than you. Why it works with a variable and not working with my measure?