Forum Discussion

Srikantht's avatar
Srikantht
Helper II
3 years ago

Count is giving difference in visual

Hi ,

 

I am getting count of active employees difference when i put same measure in visual under category of gender.

 

actual count is 167 but in table count it is showing 168. but i need 167 count in visual.  I can remove unknown in filter but i dont want to do it manually if i do it will effect to other category. 

 

my meausre is 

_# Of Active Employees =
Var Maxdate=MAX('EMPLOYEE_SNAPSHOT'[Date])
Var Result=CALCULATE (
COUNT('EMPLOYEE_SNAPSHOT'[Active_Employee_Count]),
'EMPLOYEE_SNAPSHOT'[Date]=Maxdate)
Return Result

 

 

help me from this.

Thanks in advance.

5 Replies

  • Srikantht , Try like

     

    _# Of Active Employees =
    Var Maxdate=MAX('EMPLOYEE_SNAPSHOT'[Date])
    Var Result=CALCULATE (
    COUNT('EMPLOYEE_SNAPSHOT'[Active_Employee_Count]),
    filter(allselected( 'EMPLOYEE_SNAPSHOT'),'EMPLOYEE_SNAPSHOT'[Date]=Maxdate))
    Return Result

     

    or

     

    _# Of Active Employees =
    Var Maxdate=MAX('EMPLOYEE_SNAPSHOT'[Date])
    Var Result=CALCULATE (
    COUNT('EMPLOYEE_SNAPSHOT'[Active_Employee_Count]),
    filter(allselected( 'EMPLOYEE_SNAPSHOT'),'EMPLOYEE_SNAPSHOT'[Date]=Maxdate))
    Return Sumx(values('EMPLOYEE_SNAPSHOT'[Gender]) , Result)

    • Srikantht's avatar
      Srikantht
      Helper II

      Hi amitchandak ,

       

      thank you for your quick response.

       

      I have tried your both measures but it's giving for male-167, female-167, unknown-167 values. 

       

      I am not expecting this output.

       

      Thanks

    • Srikantht's avatar
      Srikantht
      Helper II

      Hi amitchandak 

       

      Here we have multiple categories like Gender, Age group & mangment level. every category have one visual but measure is same for all. 

      here difference is coming if i have measure value 167 in card.  when it comes to category visual like for gender count is 168, for managment level count is 169 & age group count is 167. like that values are coming.

       

      I want the output 167 for all the categories. 

       

      Can you help in this.

       

      Thanks. 

       

  • Thennarasu_R's avatar
    Thennarasu_R
    Responsive Resident

     Result=CALCULATE (
    COUNT('EMPLOYEE_SNAPSHOT'[Active_Employee_Count]),AllExcept(Gender))
    Try this one 

    Thanks,
    Thennarasu R