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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.