Forum Discussion

patL's avatar
patL
New Member
1 year ago
Solved

Switch with compare Values Text

Hello - new to the community and new to DAX, i have something that up to line 4 works but how can i make line 5-6 to work?   Thanks,      
  • Irwan's avatar
    1 year ago

    hello patL 

     

    how about this (not sure if this will work since i dont test it out).

    TierBreakdown = 
    SWITCH(TRUE(),
    [Value]="D"&&([Value]="A"||[Value]="B"||[Value]="C"),"increased
    [Value]="C"&&([Value]="A"||[Value]="B"),"increased",
    [Value]="B"&&[Value]="A","increased"
    [Value]="A","decreased",
    "decreased"

    Basically SWITCH has same syntax as IF, the first line will be kicked first.

    I usually put the most specific statement so it will be kicked first.

     

    Also you need a statement then true value, while false statement will be placed at the very last.

     

    i think line 5-6 dont work because the value has been triggered by either line 3 or line 4.

     

    Hope this will help.

    Thank you.