How to fake “Key influencers chart” in Excel?
Recently, Microsoft Power BI introduced a very useful visualization, called key influencers visualization. As the name suggests, this is a chart of key parameters that effect a measure or outcome.
For example, you have customer satisfaction rating as a measure. Now you want to know which aspects of your data impact the ratings most? You can create the key influencer visual and Power BI finds all the top ranking influencers (using rules and machine learning).
The output can go like this:
Let’s look at top influencer for rating to be LOW: If role of the rating person is “Consumer” then their rating is 2.57 times likely to be low than other roles.
Likewise, if company size is <5000, then their rating is 1.48 times likely to be low than other company sizes.
As soon as I saw this chart in Power BI demo, I went…
Hot damn, that looks interesting!!! Can we get this in Excel?
Of course, Excel is a good few laps behind Power BI when it comes to data viz. But that won’t stop a data nerd, will it?
So here we go, a faked “key influencer chart in Excel”. Read on to learn how to create this yourself, from almost any data.
Key influencer chart in Excel – demo
Before we learn how to make this, let me present the chart itself.
Create your own key influencer chart in Excel…
So you are ready to make the chart? Just follow below steps and your key influencers will be identified, sorted and presented in a tidy chart.
Step 1: Arrange your data
This method works with data in one table. You can scale it to a dimensional model (star schema) with some creative pivot tables or cube formulas, but if you have gone that far, then you might as well jump to Power BI and save yourself a lot of agony.
Say your data is in a table like this. We want to investigate key influencers (from dimensions) of “Salary” column. This data is in a table named data.
Step 2: Calculate and sort influences
Now that we know our objective, let’s go ahead and crunch some numbers.
First, generate a list of all influences. This step is a bit manual, but not too hard. You can use Power Query to automate it if it gets too much.
We get something like this:
As indicated above, we need to calculate two kinds of averages.
- average of each column=criteria
- average of each column<>criteria
This is easily done by a couple of AVERAGEIFS formulas.
For example,
=AVERAGEIFS(data[salary], data[Dept], "Accounting") for "Accounting" average pay.
=AVERAGEIFS(data[salary], data[Dept], "<>Accounting") for all departments except "Accounting"
Let’s be smart then..,
Instead of writing formulas with manual criteria, we can tweak the column (data[Dept] for ex.) on the fly. After all, we know the column name.
So, let’s use this.
=AVERAGEIFS(data[Salary],INDEX(data,,MATCH(L5,data[#Headers],0)),M5)
So what does it do? This formula calculates average of data[Salary] where M5 (Accounting for ex.) is found in the column that has the same header as L5 (Dept).
Adding other calculations
Now that we have both averages, we can calculate the influence of something like this:
- Influence = average of criteria / average of not criteria – 1
- Order (rank) of influence = Individual influence’s rank in all influences
We can use simple arithmetic for 1 and RANK.AVG() for 2.
(Picture A) Summary of all the calculations so far…
Step 3: Start making the chart then…
Now that everything is ready, go to Insert ribbon and add Key Influencer chart.
Of course I’m kidding. There is no such button. But you can insert a 3D donut chart. Or may be not.
So let’s move on then.
The Key Influencer chart demo’d at the start is actually a scatter plot. See below anatomy.
10 Steps for creating the chart
(1) Make a scatter plot from “more by” and “influence order” columns
Select columns 3 & 4 as shown in Picture A and insert scatter plot. We get something like this.
(2) Reverse the chart by changing Y (vertical) axis order
Just select the Y (vertical) axis and go to axis format settings (CTRL+1 shortcut). Now select “Values in reverse order” option.
We get this.
(3) Limit vertical axis from 0 to 8
The scatter plot is showing all influences. We don’t need to see everything. So let’s limit the chart to top 8 influences. To do that, simply enter axis limits as 0 and 8.5 (if you put 8, then the last point will be hugging bottom border of chart and makes it hard to read).
You will end up with this.
(4) Replace dots with bubble
Now draw a bubble shape in the spreadsheet. Copy it (Ctrl+C). Select the dots in the chart and hit paste (CTRL+V). We get nice bubbles instead of dots in the chart. See this quick tut to understand the concept.
(5) Add data labels
Select the bubbles and add data labels. Show either X value or calculated labels from cells. Center align and adjust font settings if needed. At this point our key influencer chart looks like this:
(6) Add a dummy series with values just 1 or 2% less than influence
Now that our bubbles are ready, we need to show an arrow from 0 to the influence amount. To do this, we will use error bars, specifically 100% negative x error bars. Try saying that three times in a row.
This is easy to get. Simply add a new column to the calculations area. Write =influence – 2% and you get “Dummy for arrows” column.
Add this column to the chart. Remember, the Y values will be same as “Influence order” (Column 4 in Picture A)
(7) Add 100% negative x-error bars to the dummy series and format them
Wait a second. You can’t simply do that. So just add error bars and then,
- Remove vertical (Y) error bars
- Select horizontal (X) error bars
- Format them (CTRL+1 shortcut)
- Set bar direction to “Minus”
- Error amount to Percentage, 100%
- And end style to “No cap”
We end up with this chart.
While you are at error bar formatting screen, also adjust the bar color and begin arrow type so we get this nice arrowed error bars.
(8) Add another dummy series at -20% for axis labels
We know that top influencer increases average salary by 8.8%, but we don’t know what that is. Time to fix the problem.
Let’s create our own axis labels. Start by adding a dummy column with =-20% in the calculations area.
Also, create the label we want (this can be column & ” is ” & criteria or something else).
You need data like this.
Once that is ready, add a new series to the chart (from Select Data screen) and set X as “Dummy x for axis label” and Y as Influence Order (column 4 in picture A).
At this stage, our key influencer visual looks like this:
(9) Add the labels
Select this new dummy series, add data labels to it. Change label settings so that you can get values from cells (works only Excel 2013 or above). Point to the cells with calculated axis labels.
When everything is set up and formatted, we will have this chart:
(10) Nearly there, just clean up and format the chart
Can you feel the rush of creating something beautiful, fun and interesting in Excel? We are almost done. Just clean up the chart. Remove markers from any dummy series that are not needed. Get rid of grid lines. Add background if you want. Color things and our key influencer chart in Excel is ready.
Final touches – Form control to see positive and negative influences
Of course, the chart is nearly done. But if you want, you can dynamically show either positive or negative influencers. To do that, simply multiply the “More by” column (Column 3 in Picture A) with +1 or -1. +1 for positive influence, -1 for negative. Everything else works just as expected. You can link this to a form control and you will have a dynamic influencers chart.
Key Influencer Chart in Excel – Video tutorial
As this is a fairly complex chart, I made a video tutorial explaining all the nuts and bolts. Watch it if you need a hand with the construction.
Download Key Influencers Chart template
This file contains detailed instructions, sample data and calculations. Use it to learn or modify for your needs.
#evba #etipfree #kingexcel📤You download App EVBA.info installed directly on the latest phone here : https://www.evba.info/p/app-evbainfo-setting-for-your-phone.html?m=1