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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
ayush_mriti
Helper I
Helper I

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.

 

ayush_mriti_0-1743706036661.png

 

In the above table, EMPLID which are highlighted needs to be counted only 1 so that the total count is 7 instead of 9. Is there a solution to get this. 

Here are the DAX calculations for SM+KL Totals: 

SM+KL total =
DISTINCTCOUNTNOBLANK('Employee Output final_Current'[KL_cnt]) + DISTINCTCOUNTNOBLANK('Employee Output final_Current'[Sm_cnt])
KL_cnt = IF(
    'Employee Output final_Current'[ATR_Role] =  "Kanban Lead(s)",
     'Employee Output final_Current'[EMPLID]
     )
Sm_cnt = IF(
       'Employee Output final_Current'[ATR_Role] =  "Scrum Master(s)",
     'Employee Output final_Current'[EMPLID]
     )
Thanks in Advance.
 
4 ACCEPTED SOLUTIONS
Cookistador
Super User
Super User

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

View solution in original post

Ashish_Mathur
Super User
Super User

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

its giving me the count of 14 instead of 7.

View solution in original post

its giving me the count of 14 instead of 7.

View solution in original post

5 REPLIES 5
ayush_mriti
Helper I
Helper I

The solution worked, I just have to make some adjustment to the calculation. Thank you all.

Ashish_Mathur
Super User
Super User

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

its giving me the count of 14 instead of 7.

Cookistador
Super User
Super User

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

its giving me the count of 14 instead of 7.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.