Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 on the formula, so it doesn´t need to be changed every year, heres the code:
Solved! Go to Solution.
@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
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
@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
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Thanks ! That actually worked 🙂
@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@Anonymous , Is this you actual formula or I doubt. Why so many var when you are not using them ?
This formula seem correct. Best way to test is
SWITCH(TRUE(),
YEAR = 2019, 1,
YEAR = 2020, 2
)
Check what value it returns
Post that return A , B and E one at time and check what is wrong. May be one formula have some issue
@amitchandak Hi!
yes, its my formula, i have this many variables just for now, i will try to fix them later, since i didn´t manage to make the first part of DAX to work, i plan to make them more easy to manipulate, most of these are year specifically formulas.
I´ve tried your advice but it didn´t seems to work 😞
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |