Forum Discussion

mcijerry's avatar
mcijerry
New Member
1 year ago
Solved

A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expre

Getting the error when trying to calculate the percentage of distinct users [REGEID] with more than one device [ID] Error: A function 'CALCULATE' has been used in a True/False expression that is u...
  • bhanu_gautam's avatar
    1 year ago

    mcijerry Try using

     

    DAX
    PercentageOfUsersWithMoreThan2Endpoints =
    VAR EmployeesWithMoreThan2Computers =
    FILTER(
    VALUES('EPD Endpoints'[RegEID]),
    CALCULATE(
    COUNT('EPD Endpoints'[ID]),
    ALLEXCEPT('EPD Endpoints', 'EPD Endpoints'[RegEID])
    ) > 1
    )

    VAR CountOfEmployeesWithMoreThan2Computers = COUNTROWS(EmployeesWithMoreThan2Computers)
    VAR DistinctEmployeeCount = DISTINCTCOUNT('EPD Endpoints'[RegEID])

    RETURN
    DIVIDE(CountOfEmployeesWithMoreThan2Computers, DistinctEmployeeCount, 0)