Forum Discussion
Donut chart proportion on measure
Hi All,
Client requirement is to create donut chart and its looks like this
Data we are using here something like that
BROADCASTER, SERIES, CONTENT, CHANNEL, DEVICE_TYPE_ID, LEVEL, ALLCOCATED-PEOPLE, CF-SELECTED-PEOPLE
| 4 | 2072493 | 2072493 | 1194 | 2 | TOTAL | 1 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | SERIES | 1 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | SERIES | 1 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | SERIES | 3 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | BROADCASTER | 3 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | SERIES | 3 | 0 |
| 4 | 2072493 | 2072493 | 1194 | 2 | BROADCASTER | 1 | 0 |
| 4 | 2060294 | 2060294 | 1194 | 2 | DEVICE | 2 | 1 |
| 4 | 2060294 | 2060294 | 1194 | 2 | TOTAL | 5 | 1 |
| 1 | 1649569 | 1649569 | 1154 | 1 | DEVICE | 1 | 1 |
| 1 | 1649569 | 1649569 | 1154 | 1 | BROADCASTER | 1 | 0 |
| 1 | 1649569 | 1649569 | 1154 | 1 | TOTAL | 2 | 0 |
| 1 | 1649569 | 1649569 | 1154 | 1 | CHANNEL | 1 | 1 |
| 1 | 1649569 | 1649569 | 1154 | 1 | SERIES | 10 | 5 |
But the problem we are facing is to show proportion on a donut chart based on filter selection
If user select broadcaster in a level then blue is fine for chart, if user select any broadcaster then it should split into 2-part blue part should show selected broadcaster. And rest show unselected values mean (Broadcaster 1 is holding 10% of value it will show in blue bar and rest 90% show in gray bar).
I Created measure to calculate Percentage:
Measure = DIVIDE(
SUM('optimisation[CF-SELECTED-PEOPLE]),
SUM('optimisation[ALLCOCATED-PEOPLE]))
Need help to resolved it if possible.
Anonymous this is how you can achieve it, you need to create a few measures and use both % measures in the donut chart.
Sum Selected = SUM ( Table1[Selected] ) Sum Selected = SUM ( Table1[Selected] ) Sum Selected Unselected = CALCULATE ( [Sum Selected], ALL ( Table1 ) ) - [Sum Selected] Sum Allocated Unselected = CALCULATE ( [Sum Allocated], ALL ( Table1 ) ) - [Sum Allocated] Selected % = DIVIDE ( [Sum Selected], [Sum Allocated] ) Unselected % = DIVIDE ( [Sum Selected Unselected], [Sum Allocated Unselected] )✨ Follow us on LinkedIn and to our YouTube channel
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
1 Reply
- parry2k
Super User
Anonymous this is how you can achieve it, you need to create a few measures and use both % measures in the donut chart.
Sum Selected = SUM ( Table1[Selected] ) Sum Selected = SUM ( Table1[Selected] ) Sum Selected Unselected = CALCULATE ( [Sum Selected], ALL ( Table1 ) ) - [Sum Selected] Sum Allocated Unselected = CALCULATE ( [Sum Allocated], ALL ( Table1 ) ) - [Sum Allocated] Selected % = DIVIDE ( [Sum Selected], [Sum Allocated] ) Unselected % = DIVIDE ( [Sum Selected Unselected], [Sum Allocated Unselected] )✨ Follow us on LinkedIn and to our YouTube channel
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.