Forum Discussion
See counts by selected priority channel
Hi,
I want to know the audience count based on selected channel priority in Power Bi desktop. Audience have given their choice of movie genre, one person can like one or more than one genre. Genre are Action, Drama, Comedy and Sci fi.
Sample Data
| Audience Id | Action | Drama | Comedy | Sci fi |
| 100 | YES | YES | NO | NO |
| 101 | YES | NO | NO | YES |
| 102 | NO | YES | NO | NO |
| 103 | NO | YES | YES | YES |
| 104 | YES | YES | NO | NO |
| 105 | YES | YES | YES | NO |
| 106 | YES | NO | YES | NO |
| 107 | NO | YES | NO | NO |
| 108 | YES | YES | YES | YES |
| 109 | NO | NO | YES | YES |
| 110 | YES | YES | NO | NO |
Consider there are 4 filters:
| Priority 1 | Priority 2 | Priority 3 | Priority 4 |
| Action | Drama | Comedy | Sci fi |
User wants to know the count of movie audiences based on priority selected. If Priority 1 is "Action" then Action should not come in other priority options. Based on selected priority, User want to know the count of different audiences who are selected.
Output:
Action: 7, Drama: 3, Comedy: 1, Sci fi: 0
Note: Output counts should be mutually exclusive and Priority can be none also. If Priority 3 is none then next Priority 4 will be none automatically.
Thanks,
Abhinay
Hi Anonymous
I create four measures and show the correct result:
Please let me know if selecting "Drama", then is the count of each genre like below?
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- amitchandak
Super User
Anonymous , better you unpivot the data and then work. You can create a table Genre and join with this unpivoted table. You can also have Priority in New Genre table
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/ - v-juanli-msft
Community Support
Hi Anonymous
I create four measures and show the correct result:
Please let me know if selecting "Drama", then is the count of each genre like below?
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.