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:
Population Difference
In this example, we will list the population of all the countries and show the difference between each country and a selected country. The data source we use today is the Tableau saved data source: world indicator.

- Let’s first crate a country parameter so that we can select the country we want to compare. We need to drag country/region field to column and

2.As we need to create a parameter to select country on dashboard, we just right-click “Country/Region” field to create a parameter.

3. As we need a calculated field to show the population of the selected country, we create a field as below image:

If we drag the calculated field to the column shelf, we will get the viz as below. We can see that as the Country/Region filter applied for the selected population chart, so there’s only one bar shows, so we can’t use the population for other countries to subtract the population from the selected country.

4. Now let’s create another LOD as below:

Then we drag this new created field to column shelf and we can get the visualization as below. We can see that as we EXCLUDE the Country/Region filter, the population of the selected country shows for each row. For now, we could just use the population on the left bar chart, subtract the population on the left, we can get the population difference.

5. Let’s create another calculated field to do this calculation:

If we drag this field to column shelf, we can get the desired chart as below:

I have create a dashboard with this chart in Tableau public and hope you like it.