Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I've got a column of about 20 people and their birthdays, and I'm creating a DAX measure specifically for the nieces and nephews who will get money for their birthday. Every birthday, they will get $5 plus their age.
I'm trying to say, IF [person] = "tanya", "bobby", "sarah", "troy", then [Current Age] + $5. How do you write that in DAX? Is that a switch statement?
Thanks!
Solved! Go to Solution.
Thanks so much for your responses, guys. I ended up using a SWITCH statement:
Thanks so much for your responses, guys. I ended up using a SWITCH statement:
Hi @bonjourposte
If the goal is a calculated column you can use this formula :
If you need the measure :
Pbix with the example is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
try this:
Birthday Amount =
VAR PersonList = {"tanya", "bobby", "sarah", "troy"}
VAR CurrentAge = [Current Age] -- Replace [Current Age] with your actual column name
RETURN
IF (
[Person] IN PersonList,
CurrentAge + 5,
BLANK() -- This will return blank if the person is not in the list
)