Forum Discussion

saivina2920's avatar
saivina2920
Post Prodigy
5 years ago
Solved

How do we call variables in DAX measure

I am using below measure and i just want to call the variables.   variables ==> need to get from slicer/dropdown or any selected controls/chart values.   How do we assign controls/chart values in...
  • v-lionel-msft's avatar
    v-lionel-msft
    5 years ago

    Hi saivina2920 ,

     

    Please try this.

    EMPSTATUS = 
    VAR variables = SELECTEDVALUE('EMP QUERY'[EMP_PLACE])
    RETURN
    CALCULATE(
        DISTINCTCOUNT ( 'EMP QUERY'[EMP_NUMBER] ),
        FILTER(
            ALL('EMP QUERY'),
            'EMP QUERY'[EMP_REMARKS] in { "GOOD", "EXCELLENT"} &&
            'EMP QUERY'[EMP_COUNTRY] = "INDIA" &&
            'EMP QUERY'[EMP_PLACE] = variables
        )
    )

     

    Best regards,
    Lionel Chen

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