Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
ContactID | ID | Mobile | |
1 | 1 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 1 | 0 | 1 |
4 | 2 | 1 | 0 |
5 | 2 | 0 | 1 |
6 | 2 | 0 | 1 |
7 | 3 | 1 | 0 |
8 | 3 | 1 | 0 |
9 | 3 | 1 | 0 |
Solved! Go to Solution.
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
)
)
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
User | Count |
---|---|
23 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |