I want to illustrate how the formula area works.

To do so, let's focus on a simple calculation.

I will show you how to create a simple subtraction formula by selecting one measure,

entering a subtraction sign,

and then selecting another measure.

Let's begin by giving our new calculation a name.

We will call this, net profit.

Next, I will drag our profit to the calculation window,

then enter a subtraction sign,

and then drag our sales field to the calculation window.

If we know what field we want to use,

there is another way to do this Instead of dragging the fields to the calculation window.

We can just begin typing and then click on the field.

Tableau will automatically check to see if your calculation is valid.

You can see that Tableau tells you that the calculation is valid.

Let's purposely enter a broken formula to see what happens.

We'll take the above formula and divide it by text field, such as state.

Tableau now tells us that the calculation

contains errors and that we have a problem with our formula.

Tableau goes another step and offers a drop-down area

at the end of the error message to help us troubleshoot our mistake.

Tableau picked up right away on our text field error.

If you click on the error message,

Tableau will take your cursor to the problem area of your formula for you to fix.

When we corrected the error,

we'll click "Okay" and complete our calculation.

So, let's delete the state variable and the division sign and click on okay.

The new calculation will appear in the data window with

this special icon to indicate that it is a calculation.

Now, we can use this field in any calculation.

Next, let's see how to create a calculated field from an existing variable.

To start, let's right-click on any variable

we want to use in our new field. Let's say, profit.

Now, let's click on "Create" and then choose calculated field.

Now, we have our normal calculation window,

but we have already pulled our profit field we want to use.

From that point, you can continue creating your new calculation.

With all of the different formulas available in the calculated field window,

it's clear that Tableau provides an incredible amount of

power available for building custom formulas,

calculations, and advanced fields.

I hope this lesson helps you establish skills and the basic functions.

After that, the best way to develop mastery in Tableau is through test and explore,

which I encourage you to do.

Okay. After this lesson,

you should now understand what calculated fields

are used for and how to create new fields.

In the next lesson, we will cover

a quick table calculations that allow you to explore and explain your data even further.

Okay. After this lesson,

you should now understand what calculated fields

are used for and how to create new fields.

In the next lesson, we will cover

a quick table calculations that allow you to explore and explain your data even further.