Forum Discussion

sjinsd's avatar
sjinsd
Frequent Visitor
8 years ago
Solved

Help with SWITCH ( TRUE() with multiple items to evaluate

Hi! I am trying to evaluate eligibility based on the value of several combinations in each record.  I think I will have to use nested SWITCH functions, but I can't even get past the first one. When I...
  • v-piga-msft's avatar
    8 years ago

    Hi sjinsd,

     

    By my test with your dax expression, I get an error, do you have errors when you use the formula?

     

     

    I suggest you could add IF function to determin the type of membership at first. You could have a reference of the formula below.

     

    Column =
    IF (
        'Table1'[menbership] = "Type",
        SWITCH (
            TRUE (),
            [Age] >= 70, "Eligible",
            [Service] >= 30, "Eligible",
            [Age] > 50
                && [Service] > 10, "Eligible",
            "Not"
        ),
        "NOt"
    )
    

    The result is below.

     

    You could modify the formula above according to your requirement.

     

    Best Regards,

    Cherry