Forum Discussion

manuelfigueira's avatar
6 years ago
Solved

SWITCH Condition not working for multiples conditions!

Hello Everyone!   I'm trying to apply a condition using SWITCH(TRUE() and the last condition is not working at all. When the item age is >181 still is showing HOLD rather then RELEASE and I can't g...
  • az38's avatar
    6 years ago

    Hi manuelfigueira 

    it is correct, because 181 still more then 90, as i sure.

    try

    Measure = SWITCH(TRUE(),
    'Table1'[Condition] = "Ace", "Fly",
    RELATED('Pivot'[Status]) = "Unmatched Standard" && 'Table2'[Age] < 90, "HOLD",
    RELATED('Pivot'[Status]) = "Unmatched Standard" && 'Table2'[Age] >= 90, "HOLD"&& 'Table2'[Age] <= 180, "HOLD",
    RELATED('Pivot'[Status]) = "Unmatched Standard" && 'Table2'[Age] >= 181, "RELEASE",
    "RELEASE"
    )

    and pay attention to values 90 and 180

     

    do not hesitate to give a kudo to useful posts and mark solutions as solution

    LinkedIn