Forum Discussion
Anonymous
5 years agoNot applicable
Select Value as variable not working
Hello ! Im trying to change and old DAX that is not working anymore due to the year change, the last analyst didn´t considered year change. So my ideia is to use SELECTEDVALUE as a variable o...
- Anonymous5 years ago
Anonymous
I don't think you can just use selectedvalue() directly on the current table. Try following:1. create a new table with year column, more years if needed.
2. You do not need VAR Year, remove it. And change the return formula:
Return
SWITCH(SELECTEDVALUE(NewTable[Year]),2019, (A-A)*D,2020, (B-A)*E)
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
5 years agoAnonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.