How to Add a Total Row in Power BI

Cody Schneider8 min read

Adding a total row to your table or matrix in Power BI is one of the most fundamental steps in creating a useful report. It provides instant context, summarizing performance at a glance so you and your stakeholders can quickly see the big picture. This guide will walk you through the simple built-in options for displaying totals and also introduce more advanced DAX techniques for when you need greater control over your calculations.

Why Total Rows are Essential in Reporting

Imagine looking at a sales report with dozens of rows, each representing a different product. While the individual product performance is important, how do you instantly know the overall revenue? That's where the total row comes in. It aggregates individual data points - like sales, website sessions, or ad spend - into a single, meaningful number.

Here’s why they’re indispensable:

  • Provides a Quick Summary: Viewers can immediately see the sum of all values in a column without needing to export the data and sum it up manually in a spreadsheet.
  • Offers Context: A total row helps readers understand the scale of the individual data points. A product making $1,000 in sales is impressive if the total is $5,000, but less so if the total is $1,000,000.
  • Simplifies Decision-Making: Having a clear grand total makes it easier to track progress toward goals, evaluate overall campaign or business performance, and make informed choices.

Whether you’re building a simple table or a complex matrix, knowing how to add and customize these totals is a core Power BI skill.

The Easiest Way: Using the Built-in Totals Feature

For most users, Power BI’s built-in formatting options for Table and Matrix visuals are all you need. This approach is fast, easy, and requires no code. Let’s look at how to enable it for both visual types.

Adding a Total Row to a Table Visual

The standard Table visual in Power BI lists your data in a simple rows-and-columns format. Adding a grand total row at the bottom is just a few clicks away.

  1. Select Your Table Visual: First, click on the table in your report canvas that you want to add totals to. This will activate the settings panes on the right side of the screen.
  2. Go to the "Format your visual" Pane: On the right, you'll see a visualization pane. Click on the paintbrush icon to open the "Format your visual" tab. This is where you control the appearance of your visuals.
  3. Navigate to the "Totals" Section: Scroll down the list of formatting options until you find a section called “Totals.” Click to expand it.
  4. Turn on the Totals: You'll see a simple on/off toggle. Just switch it to "On." A total row will immediately appear at the bottom of your table, calculating the sum for each numeric column.

After you’ve enabled the total row, you can also customize its appearance right from this same section. You can change the "Title" of the total row (by default, it’s "Total"), adjust the font, text color, and background color for both the label and the values to make it stand out.

Adding Subtotals and Grand Totals to a Matrix Visual

A Matrix visual is more like a pivot table, allowing you to group and aggregate data by both rows and columns, creating a hierarchy. Because of this added complexity, you get more control over subtotals for each level of the hierarchy, plus the grand total.

  1. Select Your Matrix Visual: Click on your matrix visual to select it.
  2. Open the "Format your visual" Pane: Again, click the paintbrush icon to access formatting options.
  3. Find the Subtotal and Grand Total Sections: You'll see separate sections titled “Row subtotals,” “Column subtotals,” and a master "Totals" section for the grand total.
  4. Enable and Configure Subtotals:
  5. Enable the Grand Total: In the main “Totals” section, enable the grand total for your rows and columns. Just like with the table visual, you can customize the label and formatting from here.

Using the matrix visual gives you powerful control to show summaries at every level - for example, total sales per region (subtotal) and total company sales (grand total) all in one visualization.

When a Simple Total Is Not Enough: Getting Control with DAX

Sometimes, the default total provided by Power BI doesn't give you the correct number. This often happens with measures that perform calculations other than a simple sum, like averages or distinct counts. The default total might calculate an average of your averages instead of the true total average you were hoping for.

This is where DAX (Data Analysis Expressions) comes in. By writing a custom measure, you can tell Power BI exactly how to calculate the value for the detail rows and how to calculate a separate, correct value for the total row.

Understanding the "Incorrect Total" Problem

Imagine you have a measure to calculate the average sale price:

Average Order Value = AVERAGE(Sales[Order_Amount])

If you put this in a table of sales by city, each city gets the correct average order value. But the total row will calculate the average of the city averages, which is mathematically incorrect and not a useful business metric. What you really want is the total revenue divided by the total number of orders.

To fix this, we need a way to make our DAX formula "aware" of whether it's calculating for a single group (like a city) or for the grand total line. The two most common functions for this are HASONEVALUE and ISINSCOPE.

Creating a Custom Total with IF and HASONEVALUE

The HASONEVALUE function returns true when there's only one value in the specified column being considered - in other words, when it's operating on a detail row. We can use this inside an IF statement to provide two different calculation paths.

Let's write a smarter version of our average sales price measure:

Correct AOV =
IF(
    HASONEVALUE('Geography'[City]),
    // This is the calculation for the individual rows (one city)
    AVERAGE(Sales[Order_Amount]),
    // This is the calculation for the total row (all cities)
    DIVIDE( SUM(Sales[Order_Amount]), DISTINCTCOUNT(Sales[OrderID]) )
)

Let's break it down:

  • The IF statement checks a condition.
  • HASONEVALUE('Geography'[City]) is our condition. It asks, "Am I currently looking at just one city?"
  • If a single city is in context (returns TRUE): It performs the simple AVERAGE(Sales[Order_Amount]).
  • If multiple cities are in context (returns FALSE on the total row): It performs the correct grand total calculation: DIVIDE(Total Revenue, Total Count of Orders).

When you use this new Correct AOV measure in your table instead of the old one, it will show the correct average per city and the true overall average in the total row. This pattern is incredibly powerful for fixing issues with ratios, percentages, and averages.

A More Modern Approach with ISINSCOPE

The ISINSCOPE function is a slightly more modern and often more robust alternative to HASONEVALUE, especially when dealing with visuals that have multiple levels of hierarchies (e.g., Year > Quarter > Month).

It checks if a specific column is currently part of the context - in other words, if the calculation is happening "inside" a certain grouping level.

Here’s an example for a measure that provides a different logic for the total:

Total Sales with Correct Logic =
VAR TotalRevenueAllProducts = CALCULATE( SUM(Sales[Revenue]), ALL('Product'[Category]) )

RETURN
IF(
    ISINSCOPE('Product'[Category]),
    // Logic for when we are sliced by Product Category
    SUM(Sales[Revenue]),
    // Logic for the grand total
    TotalRevenueAllProducts
)

In this example, the formula calculates a simple sum of revenue when viewed at the product category level. For the grand total (when no single Product Category is in scope), it uses a more explicit calculation. ISINSCOPE helps you build measures that adapt gracefully to different levels of aggregation within your visuals.

Final Thoughts

Whether you're using the simple toggle in the formatting pane or writing custom DAX logic, adding a total row is crucial for creating reports that are clear, concise, and easy to understand. Mastering the built-in features first will solve most of your reporting needs, while getting familiar with DAX functions like HASONEVALUE will empower you to handle even the most complex summary calculations.

Of course, learning an entire language like DAX and navigating complex BI interfaces isn't always feasible when you just need quick answers. That's why we built Graphed. Instead of writing formulas or digging through formatting menus, you can just ask a question like, "Show me a table of my top campaigns by revenue with a total row" in plain English. We connect to your live data sources and create an interactive dashboard for you in seconds, saving you from the steep learning curve of traditional BI tools.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.