Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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 2
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

Jihwan_Kim
Super User
Super User

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"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.