Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to Create Custom Histogram / Bar Chart Based on Measures

Hi there!

Is there a way to create a histogram based on 2 measures? I have a [Total Orders] measure, which counts the number of distinct order numbers (text data type). I also have another measure for [Total Customers], which counts the number of distinct customer IDs (text data type).

 

I would like to create a histogram or bar chart which could show the count of customers that fall within a range of order counts. The "range of order counts" would be like bins, where you have e.g. 0-10, 11-50, ... , 1500-2000, etc. 

I'm thinking your "Values" pane in a clustered column visual would be the [Total Customers] measure, and your "Axis" pane would be the bins mentioned above. Not sure how to execute on this though!

4 Replies

  • samdthompson's avatar
    samdthompson
    Memorable Member

    Hello try this:

     

    1. click on the three dots in the Fields pane for the field Orders (dont worry about the measure). 

    2. selact new group and let PBI create the Bins for you.
    3. Use that new grouping on the x axis and put the customer count measure in the values. 

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi samdthompson - I've tried that, but because my order ID field is a text data type the grouping option does not include bins. It only has the "lists" grouping option

    • Anonymous's avatar
      Anonymous
      Not applicable

      My order ID field contains both text and a number e.g. R123456 and/or 1234-E, etc.

      Is there a way in which I could pull out the numbers from that field in a new column or create a unique list in numeric format? Some order IDs repeat across multiple lines.