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
jvanmeter
Frequent Visitor

Count Distinct Column B where Column A Match

I need a little help with this one as i have not found an answer that works. 

 

I have two columns.

 

Column A     Column B

Group A       Name A

Group A       Name B

Group A       Name C

Group B       Name A

Group B       Name D

Group B       Name B

Group B       Name C

 

 

I want to Group Column A and count distinct on Column B Essentially so that it looks like this without actually having to create a new table.

 

Column A     Column B

Group A        3

Group B        4

 

So I want to be able to show this in a visual where below is true 

 

Total Number of Column A Groups  Where Column B is > 100 

 

Hope That makes sense. 

2 ACCEPTED SOLUTIONS
alena2k
Resolver IV
Resolver IV

I would use calculate column, something like

Count Values = CALCULATE(COUNTA(Table1[Column B]), ALL(Table1[Column B]), Table1[Column A]= EARLIER(Table1[Column A]))

 

Maybe there is better way to calculate, but idea is to have column which you cna use in visual filter.

View solution in original post

Ashish_Mathur
Super User
Super User

Hi @jvanmeter,

 

Drag column A to the visual and then use this calculated field formula i.e. measure

 

=DISTINCTCOUNT(Data[ColumnB])

 

Now apply a criteria on the measure as > 100


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

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi @jvanmeter,

 

Drag column A to the visual and then use this calculated field formula i.e. measure

 

=DISTINCTCOUNT(Data[ColumnB])

 

Now apply a criteria on the measure as > 100


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

I would use calculate column, something like

Count Values = CALCULATE(COUNTA(Table1[Column B]), ALL(Table1[Column B]), Table1[Column A]= EARLIER(Table1[Column A]))

 

Maybe there is better way to calculate, but idea is to have column which you cna use in visual filter.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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