When the field you need isn't in the data, write it. Choose Analysis > Create Calculated Field, give the field a name and type a formula. Field names go in square brackets: [Sales] - [Profit]. The editor colors functions blue and fields orange, suggests names as you type, and says The calculation is valid. when it can run.
Most calculations are row level: Tableau works them out for every order line, and the view then adds them up like any other field. A number result lands with the measures in the Data pane. A text result lands with the dimensions.
Useful pieces:
IF [Sales] >= 200 THEN "Large" ELSE "Small" END tests each row. Add ELSEIF for more cases.
DATEDIFF('day', [Order Date], [Ship Date]) counts the days between two dates.
SPLIT([Product Name], " ", 1) returns the first word of a text.