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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JRowe
New Member

Distinct Count with AND

I need to write a dax measure that tells me how many ID's there are with email AND mobile. There is a row of data for each Contact detail, so each ID has multiple rows. Therefore I would need a distinct count of ID's. Emails and Mobiles are denoted by a 1. An example table below. so ID= 1 has an email and mobile, ID = 2 does too but ID =  3 only has email. I'm working in direct query so can't create any calculated columns to do with ID counts I think, so it has to be a measure?

 

ContactIDIDEmailMobile
1110
2110
3101
4210
5201
6201
7310
8310
9310
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @JRowe 

for a card visual please try > New measure

ID Count (E & T) =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            TableName,
            TableName[ID],
            "E&T", SUM ( TableName[Email] ) * SUM ( TableName[Mobile] )
        ),
        [E&T] > 0
    )
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @JRowe 

for a card visual please try > New measure

ID Count (E & T) =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            TableName,
            TableName[ID],
            "E&T", SUM ( TableName[Email] ) * SUM ( TableName[Mobile] )
        ),
        [E&T] > 0
    )
)

@tamerj1 that's really brilliant and worked perfectly. I was having trouble putting on filters that accounted for both email and mobile, so great solution

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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