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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

distinct count based on 2 columns with value in either

I have 2 calcuated measures counting headcount from 2 systems phone and email

 

if an agent answered the phone I count the number of unique users per day, these agents also answere email or don't

if an agent replys to an email I count the number of unique users per day, these agaents also answer phones or don't

 

I need a 3rd measure to count how many total unique agents I have 

so in this example my daily total head count should be 5

 

agent phoneemail
Bill  
Sue11
Jill 1
Joe

1

 
Jack 1
Rob11

 

currently I have

 

a call table

which has agent id, and call

 

an email table

which has agent id, and email

 

and an agent table to join the two

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I imagine you want something similar to this:

 

HeadCount =
CALCULATE (
    DISTINCTCOUNT ( Table1[agent] ),
    FILTER ( Table1, NOT ( ISBLANK ( [phone] ) && ISBLANK ( [email] ) ) )
)

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

I imagine you want something similar to this:

 

HeadCount =
CALCULATE (
    DISTINCTCOUNT ( Table1[agent] ),
    FILTER ( Table1, NOT ( ISBLANK ( [phone] ) && ISBLANK ( [email] ) ) )
)
Anonymous
Not applicable

@AlexisOlson 

 

I think this will work, so this says if phone and email are blank don't count it?

 

 

Yep. It doesn't count agents with both of those blank (I'm assuming that's why the count is 5 instead of 6 including Bill).

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.