fbpx

Advanced Pivot Table Tricks for you

Share

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Excel Pivot tables make data analysis and visualization easy. With the help of these advanced pivot table skills, you can create powerful data analytics and reports.  

Table of Contents

#1 - One Slicer, Two Pivots

Slicers are visual filters. You can filter a pivot table or chart by adding  a slicer on any field. Do you know that you can link slicer to more than one pivot table? Yes, this advanced usage of slicers makes it handy to update multiple reports with one click.

To link multiple pivot tables to same slicer:

  1. Right click on the slicer and select “Report connections”
  2. Check pivot tables that you want to connect.
  3. Done.

You can use the same approach to link multiple pivot tables with a timeline too.

Here is a video tutorial explaining this trick.

 

#2 - Distinct Count

We can easily get count, sum, average and median from our data with Pivot Tables. But what about distinct counts? You can use data model feature of Pivot tables to get distinct count. 

To get distinct count in pivot tables:

  1. Select your data and go to insert pivot table screen.
  2. On that screen, enable “Add to data model” option.
  3. Click ok to insert pivot table.
  4. Add the field you want to distinct count to the value field area of the pivot table.
  5. Go to value field settings and select summarize by “Distinct count”

Here is a video explaining the process.

#3 - Value and Percent in same Pivot

Let’s say you are looking at a pivot report detailing total sales by region. You want to know how much each region’s sales are as a percent of total sales too. That is you want both value and percent in the same report?

Simple, just add the sales field to values area again and this time use “show value as” feature to display number as % of column total.

Here is a video explaining this trick.

#4 - Layout Tricks

By default pivot tables are in compact layout. But you can change the layout, appearance and position of fields to create completely new reports. In this video tip, I will show you several powerful layout ideas to try next time you are making a pivot table. 

#5 - Two Tables, One Pivot

We can all create pivot reports from single tables or ranges of data. What if you need to create a pivot from data that is in two or more tables? You can use “Data Model” feature of Excel to connect multiple tables and create pivots from them. This technique opens up doors for advanced data analysis with ease.

To create pivot reports from multiple tables,

  1. Set up your data as tables. If the data is in ranges, simply create tables from them using CTRL+T or Insert > Table option. [Related: Introduction to Excel Tables]
  2. Set up relationships to create data model: Imagine one table of your data as Sales information and other table has Customer information. You can link them up. To set up the relationship, just go to Data ribbon and click on relationship button. [Related: Introduction to Excel Relationships]
  3. Insert a pivot table: Go ahead and insert a pivot table from any of your tables. Make sure check the “Add to data model” option at the bottom of insert pivot screen.
  4. Create pivots from multiple tables.  Now you can mash-up fields from any table to create complex business reports easily.

Here is a video summarizing the whole process with few demoes. 

#6 - Two Files, One Pivot

You already know how to make a pivot from data in one file. How about creating a pivot with data from multiple files? You can use Excel Power Query to connect to multiple files and fetch the data. We can then load this data in to “Data model” and create pivot tables from it easily.

To make pivot tables from data in multiple files:

  1. Use “Get & Transform data” option in Excel data ribbon to connect to your source data files. These can be either spreadsheets or database tables or web pages etc.
  2. Load data in to data model from Power Query so that Excel can access this data.
  3. Insert Pivot Table from the data model

[Related: Introduction to Power Query]

Watch this video to understand how to make pivots from multiple files.

#7 - Top 10 Filter

By default Pivot Tables will show all of your data. What if you want to limit the information to just top 10 records. For example, you want to see which of the sales persons are top 10 in a given region? You can use value filters to easily set up such conditions. 

To set up top 10 value filter:

  1. Create your pivot table so that all data shows up.
  2. Go to filter on the row (or column label) area. Select Value filter > top 10
  3. Set up the criteria for filtering. You can switch to “Bottom” to see bottom 10 values too. 

Here is a video explaining the process of top 10 filtering.

#8 - Measures & DAX with Power Pivot

Excel Data Model is not just for connecting multiple tables and pivoting them. Here is a secret: You can use data model to create power pivot reports too. You can apply extra calculations with DAX (Data Analysis Expressions) syntax. These calculations are called measures. 

[Related: What is Power Pivot?]

Here is a quick lesson on DAX & Measures for Excel.

#9 - Grouping Data

Let’s say you have Sales data at daily level, but you want to see totals (or averages) by month. You can use grouping feature of Excel pivot tables to quickly aggregate data to monthly or quarterly or yearly level. 

While grouping is a powerful feature of Excel pivot tables, it is not universal. If you have a data model driven pivot, then you have limited grouping choices available (dates can be grouped, but other fields won’t work).

In this trick, I will share two techniques for setting up grouping in Pivot tables to address these concerns.

#9.1 - Grouping Data without Data Model

If your pivot tables are not from data model, you can group any fields.

  • Dates can be grouped in to days / months / quarters / years
  • Numbers can be grouped by chunks
  • Text can be grouped by selecting items on the report

Here is a video detailing grouping options for non-data-model pivots.

#9.2 - Grouping Data WITH Data Model

If your pivot tables are part of data model, then you have limited grouping choices. In Excel 365 / 2019, 

  • You can group by dates

In all other versions of Excel 

  • You cannot group by on any field.

The best option for all versions of Excel is to create additional tables and link them up in the data model to mimic grouping behavior. This can be done easily with the help of Power Query.

In this video, I will show you few options to generate groupings from data using Power Query.

#10 - Conditional Formatting for Pivots

You may already know about Excel Conditional Formatting. But do you know that similar rules can be applied to Pivot Tables too? 

Yes, conditional formatting for pivots can make them pretty and presentable. My favorite types of CF for Pivots are,

  • Heatmaps (colorscales)
  • Databars
  • Icons

It is very easy to add conditional formatting to a pivot report. Just follow below steps.

  1. Select any cell with value field for which you want to apply conditional formatting.
  2. From Home > Conditional Formatting, apply the format you want.
  3. Initially, the rule will be applied only to the selected cell, But Excel will show a prompt giving choices to change the region. Select the last option (unless you want CF for grand-totals too).

Here is a video explaining some conditional formatting tricks for Pivot Tables.

#11 - Interactive Pivot Charts

You can turn any Pivot Table into a chart easily. With the power of Slicers and Timelines, you can quickly create interactive charts in Excel. Such charts provide intuitive and awesome experience to your users. 

To create an interactive pivot chart:

  1. Create a regular pivot chart (you can add one from a pivot table or create a pivot chart directly from your data)
  2. Add a slicer or timeline
  3. Now the chart will change every-time you interact with the slicer.

Here is a video explaining how to create and use interactive pivot charts.

#12 - Dashboard with Pivot Tables

Dashboards provide complete overview of a business in one view. However, they are usually complex and tricky to create. But we can use Power Query Excel Data Model, Measures, Pivot Tables, Slicers and Pivot Charts to create business dashboards quickly.

Here is a call center dashboard built using all the advanced pivot table tricks you have seen so far. 

How to create a dashboard with Pivot Tables

  1. Identity information goals for your dashboard and list them down.
  2. Create a mock-up (rough sketch) of your dashboard on paper or paint.
  3. Gather all the necessary data and set up data model (use Power Query if needed)
  4. Calculate the numbers using Pivot Tables (and simple formulas if needed)
  5. Insert a worksheet for the dashboard and place items on it by linking them to the pivot tables.
  6. Add necessary charts, conditional formats
  7. Insert slicers / timelines as needed.
  8. Include key messages + alerts as needed.
  9. Format everything.

While this process may look simple, it requires a fair bit of thought and execution. I created a detailed video explaining the steps and construction for our call center dashboard.  Please watch it below to understand everything.

 

Resources + Next Steps

Downloads

Please click here to download the files for advanced pivot tables page. In the download (zipped file), you will find 4 workbooks:

  • For non-data-model pivot table tricks – adv. pivot table tricks – 1
  • For data model pivot table tricks + dashboard – adv. pivot table tricks – 2
  • Refer to the two files in “Data for Power Query” folder for sample data.

Resources for more Pivot Table goodness

Pivot Tables make data analysis and reporting easy. In this page, I have covered a heap of techniques. But if you are hungry for more, check out below pages too.

Beginner:

Intermediate & Advanced Users:

Recommended Websites & Books:

These are my favorite places to learn more about Pivot Tables.

Websites:

Books:

Next Steps

If you found these examples and tips on Advanced Pivot Tables useful, you will love my online Excel Training Program. In this comprehensive, step-by-step course, you will learn below topics:

  • Power Query for data management
  • Tables & formatting
  • Formulas for data analysis
  • Relationships & Pivots
  • Charting & Advanced story telling
  • Time saving tips & tricks
  • Pro user techniques
  • Dashboard Reporting

If all of this sounds exciting, please check out Excel School program page for more information & sign up today.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Excel School made me great at work.
5/5

– Brenda

Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

5 Responses to “Advanced Pivot Table Tricks for you”

  1. Alan says:

    So here is an interesting one ... If one has long text in a filed in a Pivot table "ROW" and you select the column in some way to wrap the text the wrap setting does not sick on refresh. Even if "Preserve cell formatting on update" is selected the wrap setting will not keep the cells wrapped.

    Do you have a trick for this?

    • Chandoo says:

      Hi Alan... I just tested this with some made up data and the wrap setting sticks. Make sure you uncheck "Autofit columns" option and leave the the "Preserve cell formatting..." checked.

  2. V S VENKATRAMAN says:

    Dear Chandoo

    Boss you are really amazing .... thanks for sharing your knowledge .... it's really very useful.... god bless you and your family....

  3. Thanks Chandoo! Honoured to have been included in your list of pivot table resources.

  4. Ali Sho says:

    I am regular following your videos recently you hv replied about pivot table grant total on top thanks again. Unfortunately i can't attached a snapshot of another issue.
    I calculated a percentage of all. Column values from Grant total by clicking right click show value as. Some cell are empty with no values which is ok. Now after taking percentage all empty cells become 0%. I want see as an empty .
    Any thoughts.
    Thanks

Leave a Reply