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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors