Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Need Help with Dax

Hi

 

I am trying to calculate a measure that should show the value of the measure in the visual if the selected year is 2022, else it should should as "Not Applicable". 

Here is the Dax I've used. 

Count of Manager = IF(SELECTEDVALUE(Dim_Date[Year]) ="2022", CALCULATE(DistinctCOUNT(EmployeeMaster[Manager Id]),
FILTER(EmployeeMaster,EmployeeMaster[Employee Status]="Active")), "Not Applicable")

It is throwing error in the visual with "Can't Display Visual".

Please Help

2 Replies

  • Hi, 

    I am not sure how your DimDate table looks like, but I assume your year column is not Text Type.

    Please try to replace "2022" to 2022.

     

    Count of Manager =
    IF (
        SELECTEDVALUE ( Dim_Date[Year] ) = 2022,
        CALCULATE (
            DISTINCTCOUNT ( EmployeeMaster[Manager Id] ),
            FILTER ( EmployeeMaster, EmployeeMaster[Employee Status] = "Active" )
        ),
        "Not Applicable"
    )
    
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could click the" see details to check the detailed error message and click "fix it" to get tips that might fix the problem.

     

    Best Regards,

    Jay