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
mmh
Helper I
Helper I

count of two column in stacked column chart

Hi,

I have following chart, in x axis legal id and yaxis  application id (count) 

 

Capture.PNG

but i would like those  column values in X axis and Yaxis as distinct count ,  something like histogram or group by as follows: ist column 20 application having 8 legalid , 2nd column 18 application has 6 legalid and so on.

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mmh ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1668671968605.png

(2) We can create a table.

SummarizeTable = 
var _a = ADDCOLUMNS('Table',"Count",CALCULATE(COUNT('Table'[ApplicationID]),ALLEXCEPT('Table','Table'[LegalID])))
var _b = SUMMARIZE(_a,[Count],"Num",CALCULATE(DISTINCTCOUNT('Table'[LegalID]),FILTER(_a,[Count]=EARLIER([Count]))))
return _b

 (3) Then the result is as follows.

vtangjiemsft_1-1668672043284.png

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
mmh
Helper I
Helper I

Hi @Anonymous 
One more requirements, in summarized table one more column need to be added as country. legal id and application id need to filter by countries. Could you please help me on this too. 

Thanks! 

mmh
Helper I
Helper I

Thanks Neeko. 

Anonymous
Not applicable

Hi @mmh ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1668671968605.png

(2) We can create a table.

SummarizeTable = 
var _a = ADDCOLUMNS('Table',"Count",CALCULATE(COUNT('Table'[ApplicationID]),ALLEXCEPT('Table','Table'[LegalID])))
var _b = SUMMARIZE(_a,[Count],"Num",CALCULATE(DISTINCTCOUNT('Table'[LegalID]),FILTER(_a,[Count]=EARLIER([Count]))))
return _b

 (3) Then the result is as follows.

vtangjiemsft_1-1668672043284.png

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Helpful resources

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