When to Use a Histogram
- You have a numeric column (e.g., price, age, quantity, score) and want to see how many rows fall into each range (bin).
- You want a count (or similar aggregate) per bin, not individual values.
Option 1: Histogram Chart Type
If Histogram is available in the chart type list:- Create or edit a metric.
- Select Histogram as the chart type.
- Add a numeric dimension (the column you want to bin, e.g.,
order_amount). - Add a measure (e.g., Count).
- The product may automatically create bins from the numeric dimension.
Option 2: Bar Chart with Numeric Dimension
For more control over binning, use a Bar chart:-
Create a binned column in your dataset using SQL:
This creates buckets of 50 (e.g., 0-49, 50-99, 100-149).
-
Use the binned column (e.g.,
price_bucket) as the X-axis dimension. - Use the count as the Y-axis measure.
- Select Bar chart as the visualization type.
Why “Count + Bar” Might Not Look Like a Histogram
A histogram needs one bar per bin with a count per bin. Common issues:- No dimension added: If you only add a count measure without a dimension, you get a single bar. Add a dimension that represents the bins.
- Non-numeric dimension: If your dimension is categorical (not numeric), the chart shows categories instead of ranges. Use a numeric column or create bins in SQL.
- Group By has no options: Ensure your metric has at least one dimension and one measure. Some aggregation choices (e.g., window functions like
PERCENTILE_CONT) do not collapse rows into groups and may leave Group By empty.
Summary
| Goal | What to do |
|---|---|
| Use Histogram chart type | Select Histogram, add numeric dimension + measure (e.g., Count). |
| Use Bar chart | Create bins in SQL (e.g., FLOOR(col/10)*10), use as X-axis, Count as Y-axis. |
| Bins not automatic? | Create bins in SQL or a calculated column, then use as dimension. |
| Group By empty? | Ensure you have at least one dimension and one aggregate measure. |

