How To Create A Pivot Table In Notion (3 Ways)

Written by: Matthias Frank
Last edited: August 30, 2024

Pivot Tables are currently not directly supported in Notion, but that doesn’t mean we can’t replicate the functionality with a few workarounds. In this blog post, you’ll learn about three different ways to get a Pivot Table in Notion. Starting from the most specific method all the way to the most powerful, you’ll surely find a way to analyse your data.

Once you mastered Pivot Tables in Notion, don’t forget to check out my Ultimate Guide to Notion Charts. It’s the perfect add-on make more out of your databases (and upgrade the visuals in your workspace.

YouTube video

Using An Aggregation Database As A Pivot Table In Notion

Pivot Table in Notion using an aggregation table

The first method to create a Pivot Table in Notion involves a so-called aggregation table.

To make this work, you’ll create a new Notion database (which will serve as your aggregation table) and connect it to your original database using the Relation property.

This method is the least scalable of the three. It requires some manual effort for the initial setup, which means it isn’t great if you have either a ton of different options to run the analysis for or if they frequently change.

Outside these two limitations, it’s a great way though to get a quick Pivot Table in Notion without any third-party tools.

Here’s how it works:

For this example, let’s assume you run your business in Notion and have a Sales database with the following fields/properties:

  • Product Name
  • Purchase Price
  • Buyer’s Country (e.g., USA, Germany, Italy, Japan, etc.)
Sales Database in Notion

One typical use case for a pivot table would be to analyse how many sales you have per country – and how much revenue they generate.

To build this pivot table, create another Notion database (press “/” and type “Database Inline”), and name it “Pivot Table in Notion.”

In the Pivot Table in Notion database, list the names of the countries where your business operates. In our example, that would be USA, Germany, Italy, Japan, India, Australia, and Canada.

Here you see the main limitation of this approach – you need to manually define the values for which the pivot table should aggregate the numbers. Which works fine if you care about 6 countries, but can be quite cumbersome if you’d need it for 90.

Creating Pivot Table in Notion database

Next, add a Relation property and link it to the Sales database. A corresponding Relation property will also be created in the Sales database. This is necessary to pull information from the Sales database into the Pivot Table.

Now, go back to the Sales database. Under the Pivot Table in Notion (Relation property), assign all the countries from the new database to each one of the sales entries.

Adding relation to the Sales database

To automate this step for future sales, you can either set up a Notion database automation or create a new default template on the sales database that automatically connects each new record to the pivot table database.

With both databases ready, it’s time to set up your Pivot Table funcionality.

In the Pivot Table in Notion database, Create two new Formula properties to calculate:

  • Total Sales
  • Total Revenue

For Total Sales, use this Notion formula:

Items.filter(current.Buyer’s country == Name).length()

Notion formula for Total Sales

This formula filters the sales entries where the buyer’s country matches the Name (Country names) property in your aggregation database. It will display how many items have been sold in each country.

For Total Revenue, extend the previous formula with the following:

items.filter(current.Buyer’s country == Name).map(current.Purchase Price).sum().round()

Notion formula to show Total Revenue

This formula calculates the total revenue generated from each country. To display the result in USD, go to Edit Properties, and under Number Format, select US Dollars.

Showing number foormat as US Dollar

Now, you can easily see both the number of sales and the total revenue generated from each country.

If you want to aggregate data differently, you can simply adjust the formula by using functions like average, mean, or median.

And there you have it. You created a simple yet insightful Pivot Table within Notion using the Relation property and Notion Formulas.

Pretty amazing, right?

This method works well if you have a small dataset and want to quickly extract valuable insights.

But what if you’re more of a visual thinker and want a graphical representation of the Pivot Table? How do you do that?

This leads us to the second approach, where we’ll be hacking Notion Charts for a Visual Pivot Table.

How to Create A Visual Pivot Table Using Notion Charts

Pivot Table in Notion using Notion Chart

If the first method seems a bit complex to you, you’re going to love this one. It’s much simpler, and you can have a visual Pivot Table right in your Notion workspace.

Start by creating a linked view of your Sales database and selecting Charts as the new view type. This will generate a basic Notion chart from your database. You can hide the database title if you prefer.

Notion Chart to add Pivot Table in Notion

Next, click on Edit Chart and make the following customisations:

  • Chart Type: Horizontal Bar Chart
  • X Axis > What to Show: Count
  • Y Axis > What to Show: Buyer’s Country
  • Toggle on Y Axis > Omit Zero Values
Customising Chart option in Notion

By following these steps, you’ll have a neat and beautiful visual Pivot Table using the Notion chart. However, there is one major limitation with this approach.

With this method, you can only display one value at a time. Unfortunately, there isn’t currently a way to show multiple values within the same chart.

That being said, you can create a new view to show other values like Total Sales or Revenue. Additionally, you can use various aggregation options, such as sum, minimum value, maximum value, average, and more. Customise it based on what you want to analyse.

Notion Chart option for Pivot Table

It’s a simpler and much more quicker approach but it really depends on your specific use cases. Do give it a shot!

However, if you need the most scalable and robust pivot table functionality in Notion, you should opt for the last approach.

How To Create Pivot Tables in Notion Using Rows

Pivot Table in Notion using Rows

For this approach, you’ll be using Rows to create a Pivot Table inside your Notion workspace.

Rows is a modern spreadsheet tool that integrates natively with Notion – which means you can supercharge Notion with all the spreadsheet magic it’s otherwise missing.

Rows website product page

The best part? Rows offers a free plan that’s more than sufficient for this use case.

To get started, head over to Rows.com and create a free account.

Once you’ve created a new spreadsheet in Rows, the next step is to import your Sales database from Notion.

Rows new sheet page

Click on Data Action in the top bar, and a new side panel will appear. In this panel, you’ll find Notion under the Import Data section.

Importing Notion database to Rows

Select Import Data > Import a Notion Database. If Notion isn’t connected already, you’ll be prompted to connect your Notion account. Simply follow the instructions, and you’ll be good to go.

Now, go back to Notion and ensure that the page containing your Sales database is connected to Rows. If it isn’t, click the three-dot menu in the top-right corner of the page, and under Connections, select Connect to > Rows.

Connecting Notion page to Rows

Back in Rows, you should now be able to select the Sales database from Notion under the Database dropdown. Then click Create Data Table. When you import the database, it will pull in all the information from your Sales database to Rows.

Selecting the Sales database in Rows

To clean things up, head to the side panel and click on Columns & Layout. Remove any columns you don’t need for this analysis. For this scenario, you’ll only need the Product Name, Purchase Price, and Buyer’s Country columns.

Rearranging tabke columns in Rows

Now it’s time to create the Pivot Table. First, select all the rows and columns. Then, click Insert and choose Pivot Table.

Creating Pivot Table from Notion database

From the side panel, choose Rows > Buyer’s Country. Next, you’ll need two values for the table. Click the plus icon and add another value. For this example, configure the following:

  • Values 1: Purchase Price > Sum
  • Values 2: Product Name > CountA
Customising Pivot Table option in Rows

That’s it! You’ve successfully created a Pivot Table. Now, you can rename the columns as Total Revenue and Total Sales. All that’s left is to embed it into your Notion workspace.

To do this, click the three-dot icon of the Pivot Table and select Embed. In the Embed tab, toggle on Share Privately and click Copy URL.

Copying Pivot Table embed link from Rows

Go back to Notion, paste the URL as an Embed wherever you like, and voila! You now have a scalable Pivot Table inside Notion.

Embedding Pivot Table in Notion from Rows

There’s only one last step remaining: making sure that any change in Notion will be reflrected in Rows (and with that, in your pivot table).

To do so, you can either manually refresh the data source in Rows by clicking on the three dots above the table or you can schedule an automated data refresh.

To do so, click the three-dot icon of the Notion table in Rows and select Edit Data Table.

Setting up auto refresh in Rows

Under Automation, toggle on Schedule Data Refresh and choose your preferred time and frequency.

Scheduling auto refresh option in Rows

With the free plan, you can only refresh once a day. If you need a higher refresh frequency, you need to upgrade to a paid plan.

If you choose this method, don’t forget that you can also manipulate your data first in Rows through formulas to improve the output of your pivot table even further.

Looking For Free Notion Templates?

Kickstart your Notion Workspace with more than 21 free Notion Templates.

Did you miss the latest Notion Update?

New Frequency Trigger in Notion Database Automations
Explore All Updates
Automations in Notion databases got more intuitive with the Every {frequency} Trigger

Continue Reading With These Related Posts