A histogram is a graphical representation of the distribution of numerical data, grouping each value into a "bin" of values close together, and displaying the bin counts across the range of values. Dundas BI can automatically create a formula visualization that calculates and displays the frequencies of values in your dataset.
When to use a histogram?
Use a histogram when you have a single set of numeric values and are interested in which numeric values occur the most or least, and patterns in how the values occur across the total range.
2. Data preparation
Sample data: Sales as measure and Location as hierarchy.
In this example, you have data showing sales per location, and you want to show in a data visualization the distribution of the frequency of different amount of sales.
3. Calculate Histogram
You can choose to create a histogram visualization based on data that you select or by re-visualizing an existing visualization of a set of numbers:
3.1. Using the Create Histogram option
- In the dashboard editor, select the Calculate Histogram option from the toolbar.
- Drag and drop the Sales to MEASURES and Location to ROWS.
- Select the Create Histogram option from the toolbar.
3.2. Using the Re-visualize to Histogram option
- In the dashboard editor, select your existing data visualization and in the toolbar, select "Re-Visualize". You can also right-click on the visualization and select "Re-Visualize".
- Select Calculate Histogram
A new bar chart is created by default, with the histogram formula as measure (the height of the bar corresponds to the frequency of the amount of data), and "Distribution bins" used as hierarchy/bottom axis.
3.3. Using the Formula Visualization option
Refer to the histogram formula.
4. Data Analysis Panel:
The formula generated uses the Histogram function:
5. Adding a filter to dynamically change the distribution bin
By default, the bin size parameter of the Histogram formula is assigned a parameter placeholder name of $BinSizeParameter$. This makes it possible to assign this parameter placeholder to a single numeric parameter so that users can dynamically set the bin size. The sample below demonstrates how to add a single numeric filter (i.e. Slider) and connect to the $BinSizeParameter$ placeholder parameter. A Single Number filter can also be used.
- Add a Slider filter:
- Assign to the "(SingleNumber)" parameter under the "Sales Histogram Expression" measure:
- Set up the Slider properties:
View the dashboard and use the slider control:
6. Modifying the formula
If you prefer to explicitly set the parameter values, you can modify the formula to set the histogram's distribution bin and format:
Optionally, you can use the Histogram Range function to set the start and end range of the distribution bins:
7. See also
- Connect to data and view it on a dashboard
- Using chart properties
- Formulas - Histogram
- Histogram - Wikipedia