I have unpivoted a table of survey data becuase the respondents could select more than one of several options for one of the questions. I am now trying to do a distinct count, however, it only counts distinct Staff IDs, I need a distinct count based on the 'Staff ID' and 'Question 2' i.e. 2 staff members responded 'Yes'
Staff ID
|
Question 1
|
Question 2
|
1
|
Test 1
|
Yes
|
1
|
Test 2
|
Yes
|
1
|
Test 3
|
Yes
|
2
|
Test 4
|
Yes
|
2
|
Test 5
|
Yes
|
2
|
Test 6
|
Yes
|
3
|
Test 7
|
No
|
3
|
Test 8
|
No
|
3
|
Test 9
|
No
|
Would be very grateful if someone could advise how best to do this!
Thank you!
@Lumc88
calculate( distinctcount( tbl_name[ staff ID ] , tbl_name[Question 2] = "Yes" )
let me know if this helps .
If my answer helped sort things out for you,
i would appreciate a thumbs up
and mark it as the solution
It makes a difference and might help someone else too
. Thanks for spreading the good vibes!
@Lumc88
calculate( distinctcount( tbl_name[ staff ID ] , tbl_name[Question 2] = "Yes" )
let me know if this helps .
If my answer helped sort things out for you,
i would appreciate a thumbs up
and mark it as the solution
It makes a difference and might help someone else too
. Thanks for spreading the good vibes!
Power BI Monthly Update - September 2024
Check out the September 2024 Power BI update to learn about new features.
Microsoft Fabric & AI Learning Hackathon
Learn from experts, get hands-on experience, and win awesome prizes.
Fabric Community Update - September 2024
Find out what's new and trending in the Fabric Community.