Draw sunburst chart with multiple columns

I have an Excel document that looks somewhat like this:

TypeAmountDays withoutDays with littleDays with lots
Tolerable5148271206
Less tolerable4295162258
A little intolerable9195234159
Intolerable13277133115

I'd like to put Type and Amount into a pie chart. Furthermore I want to split each pie section into its other 3 columns, Days without, Days with little and Days with lots.

Sunburst seemed like a good choice to me. However for it to work I need to restructure it into some hierarchical table.

ResultInputFactor
TolerableDays with7401485
Days with little1355271
Days without1030206
Less tolerableDays with11802954
Days with little648162
Days without1032258
A little intolerableDays with17551959
Days with little2106234
Days without1431159
IntolerableDays with360127713
Days with little1729133
Days without1495115

This gives me the result I'd expect:

expected sunburst chart

I have a large dataset however and converting it all into some hierarchical data seems way too inefficient to me. Is there an easier method to get this done?

1 Answer

Reformatting data for a sunburst chart is a bit awkward, but here's a way to cut down some of the tedious steps.

First, use Data>Get & Transform Data>From Table/Range.

This will open a query against your source data:

enter image description here

Select the three right-most columns and use Transform>Unpivot Columns, so you get this:

enter image description here

Use Add Column>Custom Column, configured like this:

enter image description here

So you get this:

Use Home>Close & Load To, like this:

enter image description here

Configure the pivot table like this:

enter image description here

If your row headers have repeated values in each row of the 'Type' column, use Design>Report Layout>Do not repeat item labels so the pivot table looks like above.

Now select the entire pivot table and copy it. Paste Special as Values in some other sheet. Use the pasted result as the source of your sunburst chart.

enter image description here

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like