MIP Logo

15 Examples of Tableau LOD – Percentage of Total

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

This blog is inspired by blog: Top 15 Tableau LOD Expressions (Practical Examples).

Tableau LOD (Level of Detail) Expression is one of the most powerful tools to achieve amazing results in building dashboards. In this series of blogs, we will walk through 15 different use cases to demonstrate the usage of LOD expression.

Since this is a series blogs, please use the navigation below to jump to the one you need quickly:

Percentage of Total

I have to say there’re multiple methods of calculating the percentage of total with similar effort and LOD is only one of them.  In this example, we still connect to Sample-Superstore dataset, and we want to have a look at the sales performance for each Sub-category within its Category. So let’s start this task step by step:

1. We put two dimensions Category and Sub-category to Rows, and Sum of Sales to Columns. If we select the Marks card as Bar, we can get the result as below:

 

2. Let’s create a calculated field to calculate the sales of each category with LOD expression. In the script, we fixed the category level and sum the sales, so that even we set the viz level to Sub-category, this calculation still returns the same value.

3.Now let’s create another calculated field to show the percentage of total as shown in below image:

After that we drag this measure to label then we can mark the bars by the percentage of sales within category.

If we want to show the viz from Manufacturer level, we can click the “+” beside the Sub-Category cell and the label is the percentage of sales from one manufacturer within category.

 

I also create dashboard with related content and you can check in Tableau Public. Hope you like this blog and the dashboard.

Share this post