# Stratified Sampling in Tableau Prep | New in tableau 2023.3

> 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:** 2023-10-26
- **Format:** Video · 8 min watch · transcript available
- **Topics:** Data prep, Analytics
- **Tools:** Tableau (prep)
- **Canonical:** https://just-tim.com/posts/stratified-sampling-in-tableau-prep-new-in-tableau-2023-3
- **Watch:** https://www.youtube.com/watch?v=b91c51bBMVs

I break down how sampling works in Tableau Prep and introduce stratified sampling, a new feature in Tableau 2023.3. Using a credit dataset, I show how stratified sampling forces Prep to pull a more balanced spread of a chosen dimension so you can work with representative data while prepping.

## Key takeaways

- Stratified sampling takes your population, groups it by a chosen dimension, then randomly selects within each group so the sample is more representative
- In Tableau Prep, sampling only affects what you see while prepping — when you hit run, all records flow through to the output regardless of sample settings
- Without stratification, a rare category like loan defaults (14% of the data) can be under-represented in your sample, leaving you with too few rows to analyse
- To enable it, go to the input step, open Data Sample, choose Stratified, then pick the column to balance on (e.g. client ID stratified by default)
- Sampling keeps row counts down to avoid Tableau Prep performance and stability issues with multi-million row datasets while preserving a useful spread

## Chapters

- 0:22 What is stratified sampling?
- 1:39 How sampling works in Tableau Prep
- 2:36 The under-representation problem
- 4:39 Setting up stratified sampling
- 6:03 Why sample instead of running all rows

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/stratified-sampling-in-tableau-prep-new-in-tableau-2023-3

---
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
