Building a Dynamic Histogram (Bins and Meassures)

Version 1

    Description:  here I share an idea of how to build a dynamic histogram in different selected measure ... by adding different measure and automatically calculate the suitable Pin size of this selected measure, and finally divide the the measure based on the calculated bin size ...

     

    Note:

    We use the same formula used by Tableau to calculate the bin size

    http://onlinehelp.tableau.com/v10.4/pro/desktop/en-us/help.htm#calculations_bins.html?Highlight=size%20of%20bins

     

    you also can find the complete VIZ at the following Public link:

    Tableau Public


    Screenshot:

    1- We add the required measures to a parameter to allow user to select among them, and create calculated field to return the selected meassure

     

    2- Calculate the number of bins and bin size based on the following formulas

     

     

    3- We add a dimension that categorize the measure value into bins

     

     

    4- finally you can switch between measure histogram as follow

     

     

     

    Tableau Version: (example 10.4)

     

    Original Author:  Haitham Farouk