Tableau error Type mismatch
expected type float found boolean
CASE compares one field against each WHEN value. Your CASE field is a number, but the WHEN holds a test that returns TRUE or FALSE, so the types clash. Use IF for tests.
Which formula raises it, and what fixes it?
CASE [Sales]
WHEN [Category] = 'Tech' THEN 1.00
ELSE 0.00
ENDThe xmetric engine rejects it too.
IF [Category] = 'Tech' THEN 1.00 ELSE 0.00 ENDOn each of the 3 example rows it returns:
| Region | Sales | Category | Result |
|---|---|---|---|
| East | 20.5 | Tech | 1 |
| West | 10.5 | Office | 0 |
| West | 5.5 | Tech | 1 |
Why it works. IF evaluates the test directly. CASE only fits when you match one field against fixed values, for example CASE [Category] WHEN 'Tech' THEN 1.00 ELSE 0.00 END.
The 3 example rows
Region | Sales | Category |
|---|---|---|
| East | 20.5 | Tech |
| West | 10.5 | Office |
| West | 5.5 | Tech |
What else raises this message?
Raises it
CASE [Sales] WHEN [Sales] > 100 THEN 'Big' ELSE 'Small' ENDFixed
IF [Sales] > 100 THEN 'Big' ELSE 'Small' ENDCASE compares one value with fixed values. For conditions, use IF.
Checked on the xmetric engine: the first fails, the fix runs.
Does my formula have this problem?
Paste your formula and run it on the example rows. It uses the fields [Region], [Sales], [Category]; rename yours to match.
Runs in your browser on the xmetric engine. Nothing is uploaded.
Which functions does this involve?
What do people ask about this error?
When should I use CASE instead of IF?
Use CASE to map exact values (CASE [Region] WHEN 'East' THEN ... ). Use IF for anything with a comparison, a range or AND/OR.
Is CASE faster than IF?
It can be slightly, for long lists of exact values, but the difference rarely matters. Write the one that reads better.
Where is this message documented?
- Where the message is reported (trailhead.salesforce.com) checked October 17, 2026