Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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

42072493207249311942TOTAL10
42072493207249311942SERIES10
42072493207249311942SERIES10
42072493207249311942SERIES30
42072493207249311942BROADCASTER30
42072493207249311942SERIES30
42072493207249311942BROADCASTER10
42060294206029411942DEVICE21
42060294206029411942TOTAL51
11649569164956911541DEVICE11
11649569164956911541BROADCASTER10
11649569164956911541TOTAL20
11649569164956911541CHANNEL11
11649569164956911541SERIES105



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

  • 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.