Forum Discussion

ayush_mriti's avatar
ayush_mriti
Helper I
1 year ago
Solved

Calculation to count only 1 for duplicate items

Hi All,   I have this logic to count only 1 for duplicate EMPLID. Right now its counting all the duplicates and the total is not correct.     In the above table, EMPLID which are highlight...
  • Cookistador's avatar
    1 year ago

    Hello ayush_mriti 

    The following code should return what you need

     

    SM+KL Distinct Total =
    CALCULATE(
    DISTINCTCOUNT('Employee Output final_Current'[EMPLID]),
    FILTER(
    'Employee Output final_Current',
    'Employee Output final_Current'[ATR_Role] = "Kanban Lead(s)" ||
    'Employee Output final_Current'[ATR_Role] = "Scrum Master(s)"
    )
    )

  • Ashish_Mathur's avatar
    1 year ago

    Hi,

    Does this work?

    Measure = calculate(DISTINCTCOUNTNOBLANK('Employee Output final_Current'[KL_cnt]) + DISTINCTCOUNTNOBLANK('Employee Output final_Current'[Sm_cnt]), ('Employee Output final_Current'[ATR_Role]="Kanban Lead(s)"||'Employee Output final_Current'[ATR_Role]="Scrum Master(s)"))

  • ayush_mriti's avatar
    ayush_mriti
    1 year ago

    its giving me the count of 14 instead of 7.

  • ayush_mriti's avatar
    ayush_mriti
    1 year ago

    its giving me the count of 14 instead of 7.