Forum Discussion
Cross-tabulation based on multiple-choice questions
- 2 years ago
output :
example 1 :
explanation of how it works :
the nb of users displayed = nb of users that likes apple and plays basketball .
example 2 :
explanation of how it works :
the nb of users displayed = nb of users that likes apple and samsung and plays basketball .
Measure = var answers = VALUES('Table2'[selected]) var total_answers = COUNTROWS(answers) var users = VALUES(Table2[userid]) var add_col = ADDCOLUMNS( users, "@X" , CALCULATE(DISTINCTCOUNT(Table2[selected])) ) var res = FILTER( add_col, [@X] = total_answers ) var calc = CALCULATE( DISTINCTCOUNT(Table2[userid]), res ) RETURN calcIf 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! 🤠
output :
example 1 :
explanation of how it works :
the nb of users displayed = nb of users that likes apple and plays basketball .
example 2 :
explanation of how it works :
the nb of users displayed = nb of users that likes apple and samsung and plays basketball .
Measure =
var answers = VALUES('Table2'[selected])
var total_answers = COUNTROWS(answers)
var users = VALUES(Table2[userid])
var add_col =
ADDCOLUMNS(
users,
"@X" , CALCULATE(DISTINCTCOUNT(Table2[selected]))
)
var res =
FILTER(
add_col,
[@X] = total_answers
)
var calc =
CALCULATE(
DISTINCTCOUNT(Table2[userid]),
res
)
RETURN
calc
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! 🤠
Thank you very much, I just realized this measure works for cross-tabulation too.