Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic Histogram of Column Summed by Category Split by Slicer

Hello all!  I am currently trying to create a dynamic histogram on a stacked column chart visual.  I have a table I plan to plot on the histogram in which each row consists of a value paired with two categories.  An example of what this table could look like is below:

ValueCategory 1Category 2
#AA
#AB
#AC
#BA
#BB
#BC
#CA
#CB
#CC


My final goal is to do the following - for any data set with an arbitrary number of values in Value, Category 1, and Category 2, to create a histogram where all data that shares a category in Category 1 is summed together and is put in one bin in the histogram, and for which there is a slicer to select any number of values in Category 2 to filter on.  I have had lots of difficulty figuring out how to do this, but I recently found a way to do it in the attached power bi file below.  Unfortunately, this solution involves putting Category 1 in the legend of the stacked column chart, and some of the data sets I need to use this visual on have thousands of unique values in Category 1, which goes over the limit of categories you can put in the legend, so I need to find another way of doing this.  My solution also uses a bin table which I generate based on the minimum possible value for all categories in Category 2 and the maximum possible sum of values for all categories in Category 2, but this isn't very useful if slicing to just a few categories, so if there is a way of dynamically creating bins, that would be great too.  Thank you very much for your help!

Power BI File Here 

 

4 REPLIES 4
Anonymous
Not applicable

I have not solved this...  I thought an R visual would work, but then I got a dataset that went over the limit for 150,000 rows of data allowed in an R visual.  So I need a solution that actually is done with a stacked column chart, or some other visual native to Power Bi.

 

Greg_Deckler
Community Champion
Community Champion

Couldn't open the PBIX file location. No access. I'm not 100% sure I understand what you are after, can you show the expected output from the sample data provided?

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I'll figure out why access is denied and try to open it up.  As for pictures of the final goal, here is what I would like the histogram to look like.  The first list on the left is the list of all values, all categories in Category 1, and all categories in Category 2.  The smaller list next to it is the list of categories in Category 1 paired with the sum of all values in them.  The slicer shows which categories in Category 2 are being used in the summing.  Finally, the bar chart is the histogram of the counts of which summed values fit in each bin.  I have two pictures shown - one in which all categories in Category 2 are selected by the slicer, one in which only two categories in Category 2 are selected.

Categories A, B, and C Selected in Category 2Categories A, B, and C Selected in Category 2

 

Categories A and B Selected in Category 2Categories A and B Selected in Category 2

 

 

Anonymous
Not applicable

Just updated the link to use a different file sharing service that I believe shall work.  Here it is as well:

https://www.dropbox.com/s/6han10l15xi0nft/Example%20File.pbix?dl=0 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.