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

Group by AND count independently on a same table

Here is my data

Table1:

Name

Owner

John

Alice

Peter

Alice

Peter

John

 

Expected Result:

NameCount OwnerCount
John1Alice2
Peter2John1

 

How could I group and count 2 different columns like this and present on a same chart please

Thanks

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @TTeam ;

You could create a measure.

Measure = CALCULATE(COUNT('Table'[Name]),FILTER(ALL('Table'),[Owner]=MAX('Table'[Owner])))

then add field.

vyalanwumsft_0-1654739454580.png

The final output is shown below:

vyalanwumsft_1-1654739472198.png


Best Regards,
Community Support Team _ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @TTeam ;

You could create a measure.

Measure = CALCULATE(COUNT('Table'[Name]),FILTER(ALL('Table'),[Owner]=MAX('Table'[Owner])))

then add field.

vyalanwumsft_0-1654739454580.png

The final output is shown below:

vyalanwumsft_1-1654739472198.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @TTeam 

 

In the data the Name "Peter" has 2 different owners. So if you use both columns in one visual "Peter" will have both the corresponding owners.

 

However you can get something like this 

esha_shah2002_0-1654578359107.png

 

Using the below measures

Name_count =
CALCULATE (
COUNT ( Table1[Name] ),
ALLEXCEPT (
Table1,
Table1[Name]
)
)
 
Owner_count =
CALCULATE (
COUNT ( Table1[Owner] ),
ALLEXCEPT (
Table1,
Table1[Owner]
)
)
 
If this post helps, Accept it as a solution.

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.