# Ceiling and Floor functions in Tableau

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-05-11
- **Format:** Video · 5 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, ceiling, floor, formatting)
- **Canonical:** https://just-tim.com/posts/ceiling-and-floor-functions-in-tableau
- **Watch:** https://www.youtube.com/watch?v=TPhTdLgkANM

I walk through the CEILING and FLOOR functions in Tableau, which round numbers up and down respectively. Using average sales by subcategory from Superstore, I show how each function behaves and compare it with Tableau's automatic decimal-place rounding.

## Key takeaways

- CEILING rounds a value up to the nearest whole number while FLOOR rounds it down — think of reaching the ceiling of a room versus the floor.
- Set up a test table with decimals by using an average measure (e.g. average sales) and increasing the displayed decimal places via field formatting.
- You can write quick ad hoc CEILING/FLOOR calculations directly in the calculation window to compare results side by side without creating saved fields.
- Watch the editor quirk where typing a function immediately next to an existing one deletes the previous function — add a space first.
- Tableau's decimal-place formatting already rounds automatically (up above halfway, down below), so 215.9 displays as 216 at one decimal place.

## Chapters

- 0:09 Setting up a table with decimals
- 1:15 The CEILING and FLOOR concept
- 1:31 Applying the FLOOR function
- 2:50 Applying the CEILING function
- 3:41 Decimal-place formatting and rounding

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/ceiling-and-floor-functions-in-tableau

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
