From the course: Tableau: Mastering Calculations
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Pitfall: Calculating weighted ratios - Tableau Tutorial
From the course: Tableau: Mastering Calculations
Pitfall: Calculating weighted ratios
We want to calculate our profit margin, meaning what proportion of our sales were returned as profit. We just calculated the profit in the previous video. Let's start with this visualization that shows profit and sales per SKU and category. But we don't want to have to do the mental math. We would rather pre-calculate and display the values. To do this, we calculate the ratio of profit to sales. In a new calculated field, profit margin in percent, and the calculation here is profit divided by the total price. The calculation is valid, so we can confirm and close with "OK". Let's move this new field to the columns and we can see in the labels that can't be quite right. Well, actually, we wanted to see percentage values. Please do not touch the calculation. We already calculate a decimal value. We just need to change it to a percentage using formatting. So we go to the data pane, right-click, and go to Default Properties to change the number format. Let's set this to a percentage and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Arithmetic operators3m 32s
-
(Locked)
Pitfall: Calculating weighted ratios5m 48s
-
(Locked)
Calculating absolute values and signs2m 8s
-
(Locked)
Float to integer: Rounding and truncating3m 39s
-
(Locked)
Calculating powers2m 4s
-
(Locked)
Comparing numbers3m 14s
-
(Locked)
Challenge: Weighted discount1m 51s
-
(Locked)
Solution: Weighted discount3m 37s
-
(Locked)
-
-
-
-