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
mtm2006
New Member

Getting a distinct count of users who have all possible values of a column

Hi everyone, I have a table with two columns: containing the names of individuals and their group type.

The three possible values of Type are:  [A, B, C]

An individual can have one, two or all three of the type values. Also, the individual can have the same type multiple times.
For example, Alex has the value A and B both two times, Catherine has the value B two times, and David has the value C three times.

I would like to get a count of distinct users who have all three values of Type. Can this be done?

 

mtm2006_1-1705417921647.png

 

In this case, the output is 2, as only Alex and David each have all possible values from the Type column.

 

Thanks for your help!

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@mtm2006 

maybe you can try to create a measure

Measure = 
var tbl=SUMMARIZE('Table','Table'[User],"type num",count('Table'[Type]))
return COUNTROWS(FILTER(tbl,[type num]=3))

 11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi @mtm2006 

 

You can try the following steps:

 

1. Add an index column to a table in the Power Query.

vxuxinyimsft_4-1705460638724.png

 

If the index column is not added, the effect in the table visualization is shown below.

vxuxinyimsft_3-1705460601407.png

 

2. Create several measures as follow.

alltypeuser = 
VAR _ut = CALCULATETABLE(DISTINCT('Table'[Type]), ALLEXCEPT('Table', 'Table'[User]))
RETURN
IF( COUNTROWS(_ut) = 3, 1, 0)

 

countalltypeuser = CALCULATE(DISTINCTCOUNT('Table'[User]), FILTER('Table', [alltypeuser] = 1))

 

vxuxinyimsft_5-1705460820809.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @mtm2006 

 

You can try the following steps:

 

1. Add an index column to a table in the Power Query.

vxuxinyimsft_4-1705460638724.png

 

If the index column is not added, the effect in the table visualization is shown below.

vxuxinyimsft_3-1705460601407.png

 

2. Create several measures as follow.

alltypeuser = 
VAR _ut = CALCULATETABLE(DISTINCT('Table'[Type]), ALLEXCEPT('Table', 'Table'[User]))
RETURN
IF( COUNTROWS(_ut) = 3, 1, 0)

 

countalltypeuser = CALCULATE(DISTINCTCOUNT('Table'[User]), FILTER('Table', [alltypeuser] = 1))

 

vxuxinyimsft_5-1705460820809.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

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

ryan_mayu
Super User
Super User

@mtm2006 

maybe you can try to create a measure

Measure = 
var tbl=SUMMARIZE('Table','Table'[User],"type num",count('Table'[Type]))
return COUNTROWS(FILTER(tbl,[type num]=3))

 11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.