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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PowerBrowse
Frequent Visitor

Group By Column Type

I have a table with multiple columns. One Column is called Lic Type and another is called User.

There are six different Lic Types and multiple users can be in each Lic Type.

I want to group my report by Lic Type and after each Lic Type I want a count of the number of users from the User column for each different Lic type.

Any ideas.

Thanks.

2 ACCEPTED SOLUTIONS

Something like this?

 

Number of users = COUNT(SampleData[User])

bolfri_0-1673627091940.png

 





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

Proud to be a Super User!




View solution in original post

Hi @PowerBrowse ,

 

I think you can try ALLEXCEPT() function to create a measure or a calculated column.

Total Group by Lic Type =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[User] ),
    ALLEXCEPT ( 'Table', 'Table'[Lic Type] )
)

Result is as below.

RicoZhou_0-1673847044464.png

OR

RicoZhou_1-1673847089717.png

 

Best Regards,
Rico Zhou

 

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

7 REPLIES 7
PowerBrowse
Frequent Visitor

Both answers were of help. 

Thanks.

bolfri
Super User
Super User

Number of users = COUNT(Table[User])





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

Proud to be a Super User!




Thanks for the reply but I think you misunderstood.

I need the Number of Users for each Lic Type in the form. Each user has a Lic Type and there are 6 different Lic Types in the table.

So.... I still don't understand. Can you post here sample rows with the data you have an what do you expect from that data? It's very hard to understand what do you mean only by description.





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

Proud to be a Super User!




Lic TypeUser
AdminDenise
ReadSimon
WriteCarl
ReadJulia
ReadLaura
AdminPeter
ReadBob

 

I want to Group each Admin, Read, and write group. After each group I want to print the number of each Lic type i.e after Admin I want to print "Total = 2" because there are 2 Admin users. After Read group I want to print "Total = 4" because there are 4 Read Lic Types.

Hi @PowerBrowse ,

 

I think you can try ALLEXCEPT() function to create a measure or a calculated column.

Total Group by Lic Type =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[User] ),
    ALLEXCEPT ( 'Table', 'Table'[Lic Type] )
)

Result is as below.

RicoZhou_0-1673847044464.png

OR

RicoZhou_1-1673847089717.png

 

Best Regards,
Rico Zhou

 

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

Something like this?

 

Number of users = COUNT(SampleData[User])

bolfri_0-1673627091940.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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