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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Create histogram out of id count

Hi all,

 

I need help with creation of dynamic histogram.

 

I have a table with one columns being Case ids, that can appear multiple times.

I need to create a column chart with x axis showing, 0,1,2,3,4..... which represent how many times case id appears in a table, and y axis showing how many distinct Case ids are in that category? 

 

I have tried summarise and groupby daax, but nothing i tried worked.

Example of what i have:

Case Id
123
234
345
456
123
123
345

 

Example of what i am trying to achieve:

Count CategoryNumber of distinct cases
12
21
31

 

PLease assist

Thank you

Filarap

1 ACCEPTED SOLUTION
SteveCampbell
Memorable Member
Memorable Member

There is a custom visual called Histogram, available in the store.

 


Otherwise, if you don't want to use a custom visual:

(Edit from my last answer to make dynamic:)

Create this table:

Hist = GENERATESERIES(1,100,1)

 

Then this measure:

Histogram Values = 
var _table= ADDCOLUMNS(VALUES('Table'[Column1]),"CountValue",CALCULATE(COUNT('Table'[Column1])))

var _selected = SELECTEDVALUE(Hist[Value])

RETURN 
COUNTX(FILTER(_table,[CountValue]=_selected),[CountValue])

Change 'Table'[Column1] to your Column.

Now make a column chart and use Hist[Value] in the axis, and the measure [Histogram Values] in values.

 

 

 

Love hearing about Power BI tips, jobs and news?
I love to share about these - connect with me!

Stay up to date on  linkedin-logo.png
Read my blogs on  powerbi.tips_.png

Remember to spread knowledge in the community when you can! tu.png



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



View solution in original post

1 REPLY 1
SteveCampbell
Memorable Member
Memorable Member

There is a custom visual called Histogram, available in the store.

 


Otherwise, if you don't want to use a custom visual:

(Edit from my last answer to make dynamic:)

Create this table:

Hist = GENERATESERIES(1,100,1)

 

Then this measure:

Histogram Values = 
var _table= ADDCOLUMNS(VALUES('Table'[Column1]),"CountValue",CALCULATE(COUNT('Table'[Column1])))

var _selected = SELECTEDVALUE(Hist[Value])

RETURN 
COUNTX(FILTER(_table,[CountValue]=_selected),[CountValue])

Change 'Table'[Column1] to your Column.

Now make a column chart and use Hist[Value] in the axis, and the measure [Histogram Values] in values.

 

 

 

Love hearing about Power BI tips, jobs and news?
I love to share about these - connect with me!

Stay up to date on  linkedin-logo.png
Read my blogs on  powerbi.tips_.png

Remember to spread knowledge in the community when you can! tu.png



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors