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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

A problem of how many 'companies' have how many 'users'?

Hi, I have a list of user IDs and their companies and I need to know, how many companies have how many users. Expected result looks like this: (4 companies have each only 1 userID, 2 companies have 2 users in total and 2 companies have 3 users in total.)

 

count.png

 

and my data is a list of user IDs and Companies. It looks like this:

 

Company

UserID
A1
A2
A3
B4
B5
C6
D7
E8
F9
G10
G11
G12
H13
H14

 

I have a hard time even naming this problem and searching the internet for it. 🙂 Could you help in DAX or PowerQuery?

 

And a bonus question is creating data segments like: How many companies have between 1-2 users in total? How many have 3-5 users in total? Again plotting in in a chart like following:

 

count.png

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Powerbi won't let you put a measure on the axis so you could create a summary table e.g. 

TableE = SUMMARIZECOLUMNS( TableP[Company], "countOff", COUNTROWS(TableP)) 

which will allow you to put countOff on the axis and COUNT of Company in the Values.

---------------------

The 2nd part is a binning solution.  You can create a calculated column in the new summary table or use the binning features

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning 

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

Powerbi won't let you put a measure on the axis so you could create a summary table e.g. 

TableE = SUMMARIZECOLUMNS( TableP[Company], "countOff", COUNTROWS(TableP)) 

which will allow you to put countOff on the axis and COUNT of Company in the Values.

---------------------

The 2nd part is a binning solution.  You can create a calculated column in the new summary table or use the binning features

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors