Today prepare for the next tutorial signed btProvider, where we will teach you how to customize totals to show different values than the main table of the view. For this, you can use the function SIZE () to differentiate between different parts of the view in a calculation. For example, showing a different measure or returning a Percent of Total in the Grand Totals while showing SUM([Sales]) in the view.
Are you ready to start? Follow the next instructions, step by step:
→ In Tableau Desktop, connect to Sample – Superstore sample data provided by Tableau.
→ Create Calculated Field called “Custom GT”:
IF Size() > 1
THEN MAX([Profit])
ELSE SUM([Sales])
END
→ Place the calculated field [Custom GT] in the view
→ Right-click the calculated field [Custom GT] and select Edit Table Calculation… and select Pane (across and then down).
→ Create Calculated Field called “Size” using the following formula:
SIZE ()
→ Create Calculated Field called “Custom GT 2” using the following formula:
IF [Size] > 1
THEN SUM(Sales)
ELSE SUM(Sales)/TOTAL(SUM(Sales))
END
→ Build the view with the desired dimensions.
→ Place the calculated field [Custom GT 2] in the view.
→ Right-click on [Custom GT 2] in the Marks card and select Edit Table Calculation…
→ In the Table Calculation dialogue, set the Nested Calculations to [Size]
→ Under Compute Using choose Pane (across and then down) and click OK.
→ Right-click on [Custom GT 2] in the Marks card and select Format…
→ In the left-hand Format pane, Under Totals, in the Numbers dropdown, select Percentage
If you like video tutorials, we recorded for you the entire process as you can see in the #skillpill video below, created by our colleague Andreea Chiriac, Data Analyst.
As Tableau Software Premier Partner we are continuously advising and supporting our customers in using Tableau on a daily basis. This means analysing the data and understanding its evolution through creative and insightful dashboards. Our team of Data Analysts are qualified to explain and guide the company’s internal data teams in the journey to become more data-driven.
We hold the technical and sales certifications for all products: Tableau Desktop, Tableau Server, Tableau Prep, Tableau Data Management.
With Tableau Software you can always understand your business or your job better. Using Tableau, you will take smart and strategic decisions and you will quickly understand the data flow, numbers and results it produces.
Are you interested in learning more about Tableau or implement the solution in the entire company? Contact us!
In Tableau, “Measure Names” is a special field that automatically includes all the measure names (numeric fields) in your data source. It’s a dynamic field that allows you to switch between different measures in your visualizations without having to manually […]
On October 18 we hosted a new private event btProvider & Tableau, titled “Data & AI: Unveiling Tableau’s Magic”.
A diverging bar chart in Tableau is an efficient method for comparing two categories based on a single measure, clearly highlighting the differences. These charts are particularly useful when we want to emphasize discrepancies between two sets of data or […]