#### The TOTAL() function in Tableau is a table calculation function that allows you to compute aggregations across the entire visualization or a specific dimension, regardless of the level of detail of the view. It calculates the total value of a field or expression without considering any filters or dimensions in the view.

The syntax for the TOTAL() function in Tableau is as follows:

#### TOTAL([expression])

- [expression]: The field or calculation for which you want to calculate the total.

Here's an example to demonstrate how to use the TOTAL() function in Tableau:

Suppose you have a dataset that contains information about the monthly sales of different products. You want to calculate the percentage contribution of each product's sales to the total sales across all products.

- Open Tableau and connect to your dataset.
- Create a view that includes the "Product" field and the "Sales" field.
- Right-click on the "Sales" field in the view and select "Add Table Calculation."
- In the Calculation Type drop-down, select "Percent of Total."
- In the "Compute Using" section, choose the appropriate dimensions to define the partitioning and addressing for the calculation (e.g., "Product").
- Click "OK" to apply the table calculation.

Tableau will calculate the percentage contribution of each product's sales to the total sales across all products. The TOTAL() function is used behind the scenes to compute the total sales value for the denominator.

You can further customize the view, apply sorting, or add additional calculations based on the total. For example, you can create a visualization that shows the relative contribution of each product's sales to the total sales or compare the percentages across different time periods.

The TOTAL function allows you to perform calculations related to the total value of a field or expression. It helps you analyze the relative contribution or distribution of values within the context of the entire visualization.

## No comments:

## Post a Comment

If you have any doubts. Please let me know