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

Create a Frequency Histogram from one column

Hello everyone! I am new using Power BI and also in this forum and a have a little question

¿How do you create an histogram where you can see the number of repetitions of each data?

My problem is that I don't have a summary table. I mean, my data is like this:

 

Occupancy of the car:

1

1

2

2

2

3

 

And I want a graph with 3 columns (a typical histogram :D)

1 person --> 2 repetitions

2 person --> 3 repetitions

3 person --> 1 repetition

 

Thank you in advanced 🙂

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

Here is one way. Go to Modeling tab and create a new table with this formula:

 

Table5 = DISTINCT(Table4[Occupancy of the car:])

Now, in that table, create a new column with this formula (Table4 is your original table):

 

Column = COUNTX(FILTER(ALL(Table4),Table4[Occupancy of the car:]=Table5[Occupancy of the car:]),[Occupancy of the car:])

Use your new table for your histogram.



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...

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Drag number of passengers to the Table visual and write this measure

 

=COUNT(Data[Passengers])

 

Change your visual to a Column chart.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Drag number of passengers to the Table visual and write this measure

 

=COUNT(Data[Passengers])

 

Change your visual to a Column chart.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

Here is one way. Go to Modeling tab and create a new table with this formula:

 

Table5 = DISTINCT(Table4[Occupancy of the car:])

Now, in that table, create a new column with this formula (Table4 is your original table):

 

Column = COUNTX(FILTER(ALL(Table4),Table4[Occupancy of the car:]=Table5[Occupancy of the car:]),[Occupancy of the car:])

Use your new table for your histogram.



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...

@Greg_Deckler Say we had an additional colum in Table 4 which had three different car colours; red, blue, and yellow. The data could look like:

Occupancy of the car:    Car Color:

1                                     Red

1                                     Blue

1                                     Blue

2                                     Red

3                                     Yellow

3                                     Red

 

I want to be able to filter the relative frequency graph for each car color. How would I do this?

Anonymous
Not applicable

Thank you so much! It works 🙂

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.