A calculated field is used to create new (modified) fields from existing data in the data source. It can be used to create more robust visualizations and doesn’t affect the original dataset.
For example, let’s calculate the “average delay to ship.”
The data set considered here has information regarding order date and ship date for four different regions. To create a calculated field:
- Go to Analysis and select Create Calculated Field.
- A calculation editor pops up on the screen. Provide a name to the calculated field: Shipping Delay.
- Enter the formula: DATEDIFF (‘day’, [Order Date], [Ship Date])
- Click on Ok.
- Bring Shipping Delay to the view.
- Repeat steps 1 to 5 to create a new calculated field ‘Average Shipping Delay’ using the formula: AVG (DATEDIFF (‘day,’ [Order Date], [Ship Date]))
- Drag Region field to Rows shelf and SUM(Average Shipping Delay) to the marks card; the average delay for each region gets displayed.