Tableau Histogram is useful to visualize the statistical information that organizes within the user-specified range. Although it looks like a Bar chart, Histogram in Tableau displays data in equal intervals.
This section shows how to Create Tableau Histogram chart with an example. For this histogram chart in tableau demo, we use a custom query against the SQL Server.
SELECT Geo.EnglishCountryRegionName, Geo.StateProvinceName, Geo.City, Prod.EnglishProductName, Prod.Color, Fact.OrderQuantity, Fact.TotalProductCost, Fact.SalesAmount, Fact.TaxAmt, Fact.[Freight] FROM DimProduct AS Prod INNER JOIN FactInternetSales AS Fact ON Prod.ProductKey = Fact.ProductKey INNER JOIN DimSalesTerritory AS Terry ON Terry.[SalesTerritoryKey] = Fact.[SalesTerritoryKey] INNER JOIN DimGeography AS Geo ON Geo.[SalesTerritoryKey] = Terry.[SalesTerritoryKey]
Steps to create a Tableau Histogram
The following are the steps to create a histogram in Tableau desktop.
Show Me button: To create a Tableau histogram, Drag and Drop the Sales Amount from Measures Region to Text filed in Marks card. Next, select the shown option from the Show Me window.
Add Sales Bin dimension to create a chart: Once you select the Histogram option, a new Bin will create on the Sales Amount. Tableau Histogram will automatically add Sales Amount bin dimension on Columns shelf and SalesAmount measure on Rows Shelf. As you see, the default equally sized bin is 500. But you can change the range distribution of data or adjust the bin size by editing it.
Change Aggregate Function: From the above data visualization, see that the SalesAmount on Rows shelf is aggregated by Count rather than Sum. To change the aggregate function, Please click on the down arrow beside the measure and change the Measure value from Count to Sum. Please refer to Tableau Bins to learn creating bins and editing them. And also refer to Connecting to SQL Server and Bar chart in Tableau.
Once you select the Sum option, Histogram in Tableau will display the Sum of Sales Amount against the Sales Amount Bin.
Display Percentages in Histogram chart: Our task is to display the Percentage of Total. To do that, select Quick table Calculation option from the menu and then choose the Percentage of Total.
Once completed, it will display the Total Percentage of Sales Amount against the SalesAmount Bin.
How to edit Table Calculation
If you want to edit the table calculation of a Tableau Histogram, Please choose Edit Table Calculation..
Once you choose the Edit Table Calculation.. option, a new window called Table Calculation will open to change the calculation type. From this drop-down list, select the required calculation.