Forum Discussion
Group by AND count independently on a same table
Here is my data
Table1:
| Name | Owner |
| John | Alice |
| Peter | Alice |
| Peter | John |
Expected Result:
| Name | Count | Owner | Count |
| John | 1 | Alice | 2 |
| Peter | 2 | John | 1 |
How could I group and count 2 different columns like this and present on a same chart please
Thanks
Hi, TTeam ;
You could create a measure.
Measure = CALCULATE(COUNT('Table'[Name]),FILTER(ALL('Table'),[Owner]=MAX('Table'[Owner])))then add field.
The final output is shown below:
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.
2 Replies
- AnonymousNot 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
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. - v-yalanwu-msft
Community Support
Hi, TTeam ;
You could create a measure.
Measure = CALCULATE(COUNT('Table'[Name]),FILTER(ALL('Table'),[Owner]=MAX('Table'[Owner])))then add field.
The final output is shown below:
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.