Skip to content

Calculated Fields Interview Questions for Tableau

23 Calculated Fields questions with answers for tableau roles — 7 easy, 13 medium, 3 hard.

About Calculated Fields

Calculated fields add business logic to your data. Practise row-level and aggregate calculations, logical functions such as IF and CASE, string and date functions, null handling, type conversion and user functions for security. Interviewers test whether you can write ratios, YTD comparisons and flags correctly and fix common calculation errors.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is a calculated field in Tableau?

Save to ▾
Show answer
A calculated field is a new field created from existing data using Tableau's formula language. It can perform arithmetic, string manipulation, date logic, conditional logic, aggregations, LOD expressions or table calculations. Calculations are saved in the data source of the workbook and can be reused on any sheet. Examples are profit ratio, customer age group, or a flag for late deliveries.
02

What are the main categories of functions in Tableau calculations?

Save to ▾
Show answer
Tableau offers number functions such as ROUND and ABS, string functions such as LEFT, CONTAINS and SPLIT, date functions such as DATEDIFF, DATEADD and DATETRUNC, type conversion such as STR, INT and DATE, logical functions such as IF, CASE and IIF, aggregate functions such as SUM and COUNTD, user functions such as USERNAME, and table calculation functions such as RUNNING_SUM and RANK.
03

What is the difference between row-level and aggregate calculations?

Save to ▾
Show answer
A row-level calculation is computed for each record, for example [Sales] - [Cost]. An aggregate calculation works on groups at the view level, for example SUM([Profit]) / SUM([Sales]). Mixing them in one expression causes the error cannot mix aggregate and non-aggregate arguments. Ratios should usually be aggregate so they are correct at any level, instead of averaging row-level ratios.
04

What is the difference between IF, IIF and CASE in Tableau?

Save to ▾
Show answer
IF supports multiple conditions with ELSEIF and complex logical tests. IIF is a compact form taking a test, a true value, a false value and an optional unknown value for nulls. CASE compares one expression against exact values and is easier to read for many fixed options, such as parameter selections. CASE cannot test ranges like Sales greater than 1000, so use IF for that.
05

Write a calculation for profit ratio and a profit flag.

Save to ▾
Show answer
Profit Ratio: SUM([Profit]) / SUM([Sales]) Profit Flag: IF SUM([Profit]) > 0 THEN 'Profitable' ELSEIF SUM([Profit]) = 0 THEN 'Break-even' ELSE 'Loss' END Format Profit Ratio as percentage. Both are aggregate, so they work at any view level.
06

How do you calculate the number of days taken to ship an order?

Save to ▾
Show answer
Days to Ship: DATEDIFF('day', [Order Date], [Ship Date]) Late Flag: IF DATEDIFF('day', [Order Date], [Ship Date]) > 4 THEN 'Late' ELSE 'On time' END Use AVG(Days to Ship) per region to compare delivery performance.
07

What is the difference between a calculated field and an ad-hoc calculation?

Save to ▾
Show answer
A calculated field is created through the Analysis menu or Data pane and saved in the data source for reuse. An ad-hoc calculation is typed directly into a pill on Rows, Columns or the Marks card by double-clicking, useful for quick tests. Ad-hoc calcs can be dragged to the Data pane to save them. Saved fields are better for maintainability and naming.
08

How does Tableau handle null values in calculations?

Save to ▾
Show answer
Most operations involving a null return null, so [Sales] + null is null. Use ZN to convert null numbers to zero, IFNULL to replace nulls with a value, and ISNULL to test for them. Aggregations such as SUM ignore nulls. In charts, nulls may appear as an indicator at the bottom right, and you can choose to filter, show at default position or hide them.
09

Why is SUM([Profit])/SUM([Sales]) better than AVG([Profit]/[Sales])?

Save to ▾
Show answer
SUM over SUM gives a weighted ratio that reflects total profit against total sales at whatever level the view shows. AVG of a row-level ratio gives every order equal weight, so a tiny order with high margin distorts the result. Business users expect the weighted ratio, which also matches totals in finance reports. Always build ratios as aggregate calculations.
10

What are the important date functions in Tableau?

Save to ▾
Show answer
DATEPART returns an integer part of a date such as month number. DATENAME returns the name, such as March. DATETRUNC truncates to a level, giving a date such as the first of the month. DATEADD adds intervals, DATEDIFF computes the difference between two dates in a unit, MAKEDATE builds a date, and TODAY and NOW return the current date and time.
11

What are user functions and how are they used for row-level security?

Save to ▾
Show answer
User functions such as USERNAME, FULLNAME, ISMEMBEROF and USERDOMAIN return details of the person viewing the workbook on Server or Cloud. A calculation like [Manager Email] = USERNAME() or ISMEMBEROF('North Team') can be used as a data source filter set to true. Each user then sees only their rows. This is a common way to implement row-level security in Tableau.
12

Extract the first name from a full name field.

Save to ▾
Show answer
Using SPLIT: SPLIT([Customer Name], ' ', 1) Using FIND and LEFT: LEFT([Customer Name], FIND([Customer Name], ' ') - 1) Trim spaces first if data is messy: SPLIT(TRIM([Customer Name]), ' ', 1) SPLIT is simpler, while the second method shows string function skills.
13

Write a calculation for year-to-date sales compared with last year to date.

Save to ▾
Show answer
YTD Sales: IF YEAR([Order Date]) = YEAR(TODAY()) AND [Order Date] <= TODAY() THEN [Sales] END LYTD Sales: IF YEAR([Order Date]) = YEAR(TODAY()) - 1 AND [Order Date] <= DATEADD('year', -1, TODAY()) THEN [Sales] END Growth: (SUM([YTD Sales]) - SUM([LYTD Sales])) / SUM([LYTD Sales])
14

Create age buckets for customers using a calculation.

Save to ▾
Show answer
Age Group: IF [Age] < 18 THEN 'Under 18' ELSEIF [Age] <= 25 THEN '18-25' ELSEIF [Age] <= 35 THEN '26-35' ELSEIF [Age] <= 50 THEN '36-50' ELSE '50+' END To sort buckets correctly, create a sort order calculation or sort manually.
15

How do you calculate the current month and previous month sales in a KPI?

Save to ▾
Show answer
Current Month: IF DATETRUNC('month', [Order Date]) = DATETRUNC('month', TODAY()) THEN [Sales] END Previous Month: IF DATETRUNC('month', [Order Date]) = DATEADD('month', -1, DATETRUNC('month', TODAY())) THEN [Sales] END MoM %: SUM([Current Month]) / SUM([Previous Month]) - 1
16

You get the error cannot mix aggregate and non-aggregate arguments. How do you fix it?

Save to ▾
Show answer
The formula mixes a row-level field with an aggregated one, such as IF [Sales] > AVG([Sales]). Either aggregate everything, for example IF SUM([Sales]) > 1000, or make everything row level. If you need to compare a row with an overall average, use an LOD such as [Sales] > {FIXED : AVG([Sales])}, which returns a row-level value that can be mixed safely.
17

Business wants financial year April to March in reports. How do you handle it?

Save to ▾
Show answer
Right-click the date field, choose Default Properties, then Fiscal Year Start, and select April. Tableau then shows FY quarters and years based on April. For a label such as FY 2025-26, create a calculation: IF MONTH([Order Date]) >= 4 THEN STR(YEAR([Order Date])) + '-' + RIGHT(STR(YEAR([Order Date]) + 1), 2) ELSE STR(YEAR([Order Date]) - 1) + '-' + RIGHT(STR(YEAR([Order Date])), 2) END.
18

A CSV loads dates as strings like 15-08-2025. How do you convert them?

Save to ▾
Show answer
Try changing the data type to Date first; Tableau may parse it automatically. If not, use DATEPARSE with the pattern: DATEPARSE('dd-MM-yyyy', [Date String]). For extracts and most databases this works reliably. Alternatively use MAKEDATE with INT of SPLIT parts. Then check for nulls, which indicate rows with a different format that need cleaning.
19

Describe a time you had to learn a new Tableau feature quickly for a project.

Save to ▾
Show answer
Situation: a client needed a what-if pricing dashboard in one week. Task: I had not used parameter actions before. Action: I studied official help pages, built a small prototype on sample data, and asked a senior to review it before applying it to real data. Result: the dashboard launched on time and the client used it in a pricing review meeting.
20

A string calculation CONTAINS([Product], 'phone') misses some rows. Why?

Save to ▾
Show answer
CONTAINS is case-sensitive in many sources, so Phone or PHONE will not match. Use CONTAINS(LOWER([Product]), 'phone') to normalise case. Also trim extra spaces and check for nulls. If you need complex patterns, use REGEXP_MATCH where the data source supports it. Test the result by counting matched rows and reviewing samples.
21

How do calculations affect performance, and what are best practices?

Save to ▾
Show answer
Row-level calculations on large live sources run in the database for every query, so heavy string operations and nested IFs can be slow. Best practices are to use booleans and integers instead of strings, prefer CASE for fixed lists, move complex logic to the database or extract, materialise calculations in extracts, avoid unnecessary COUNTD, and keep LODs and table calculations simple.
22

A dashboard with many nested IF calculations on 50 million rows is slow. What would you change?

Save to ▾
Show answer
Run a performance recording to confirm calculations are the bottleneck. Replace string comparisons with integer or boolean logic, convert long IF chains on single values to CASE, move derived columns into the database view or an extract so they are materialised, and remove unused calculations. Hide unused fields before extracting. Measure again after each change to show improvement.
23

Different analysts calculate active customer differently. How do you resolve it?

Save to ▾
Show answer
Agree on a business definition with stakeholders, such as a customer with at least one order in the last 90 days, and document it. Create one calculated field using an LOD on the last order date, add it to a certified published data source with a description, and deprecate old versions. Communicate the change and compare old and new numbers so users understand the difference.

Frequently asked questions

How important is Calculated Fields in Tableau interviews?

Calculated fields add business logic to your data. Practise row-level and aggregate calculations, logical functions such as IF and CASE, string and date functions, null handling, type conversion and user functions for security. Interviewers test whether you can write ratios, YTD comparisons and flags correctly and fix common calculation errors.

How should I use the Calculated Fields sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.