Forum Discussion
Has value based on id
- 2 years ago
jochendecraene
The the following two measures:With_F2F = CALCULATE( DISTINCTCOUNT( Table02[caseid] ), Table02[Face to face] = "YES" )No_F2F = SUMX( DISTINCT( Table02[caseid] ), CALCULATE( INT(NOT "YES" IN VALUES( Table02[Face to face] ))) ) - 2 years ago
Ok jochendecraene
This is a little tricky.The measures you can use :
1.
Count_face_to_face =COUNTX(CALCULATETABLE('Table','Table'[Type]="face to face"),DISTINCTCOUNT('Table'[Id]))2.Count_others =VAR t =SUMMARIZE('Table','Table'[Id],"face_to_face_count",[Count_face_to_face])RETURNCALCULATE(DISTINCTCOUNT('Table'[Id]),FILTER(t,ISBLANK([face_to_face_count])))Result :Pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Ritaf1983 Fowmy thank you both very much! Both solutions are good!
I found another solution using power query, by combining all the values per id in 1 colom, add an if statement and than simply calculate bases on the outcome of the if statement.
Is this a good alternative approach?
Next questions a need to anwser are:
- how much types of contacts are there per id
- wich combinations of contacts and how many are there in the whole dataset
For the first question I would simply count the words per id
The second one for me is more difficult. I would have to take a step back and remove all doubles and then write if statement for the possible cominations
Are there any dax solutions for these 2 questions based on the orginal table?
- Ritaf19832 years agoSuper User
Hi jochendecraene
If you need to analyze data row by row, combining rows as you did, is not a good practice.
About the combinations, it seems like a logic of bucket analysis, please check these links:https://blog.finance-bi.com/power-bi-basket-analysis/
https://www.daxpatterns.com/basket-analysis/
https://www.youtube.com/watch?v=yzDGvZEtYdQ
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- jochendecraene2 years agoHelper V
Ritaf1983 thank you for your feedback and the links. This is helpfull!
- Ritaf19832 years agoSuper User
Happy to help 🙂