Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Switch Function not giving expected result

Hello Forum, I want to create a calculated column which uses a value from another column and result is based upon that but it is giving me blank Dax for calculated column as below Column = switch(...
  • v-angzheng-msft's avatar
    4 years ago

    Hi, Anonymous 

     

    Try this:

    Column = 
    SWITCH (
        'Table'[Column1],
        "a",
            CALCULATE (
                SUM ( 'Table'[Column2] ),
                ALL('Table'),
                'Table'[Column1] = "f",
                'Table'[Column3] = 2020
            )
    )
    

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.