Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Multiple TRUE values on a SWITCH TRUE(); Function

Hello PBI Community!   I have a SWITCH function that evaluates with the value in one particular column of my table is true (name of an employee) to call a specific Measure as Value for a visual. Th...
  • nandukrishnavs's avatar
    6 years ago

    Anonymous 

     

    Try this measure

    Measure =
    VAR _colab =
        VALUES ( 'All'[COLAB] )
    VAR result =
        SWITCH (
            TRUE ();
            "Employee 1" IN _colab; [# Total Hours Worked by Employee 1];
            "Employee 2" IN _colab; [# Total Hours Worked by Employee 2];
            "Employee 3" IN _colab; [# Total Hours Worked by Employee 3];
            "Employee 4" IN _colab; [# Total Hours Worked by Employee 4];
            "Employee 5" IN _colab; [# Total Hours Worked by Employee 5];
            "Employee 6" IN _colab; [# Total Hours Worked by Employee 6];
            "Employee 7" IN _colab; [# Total Hours Worked by Employee 7];
            [_Sum Spend Time by All]
        )
    RETURN
        result



    Did I answer your question? Mark my post as a solution!
    Appreciate with a kudos
    ๐Ÿ™‚