Forum Discussion
MasterSonic
3 years agoHelper IV
Count rows per category
Hi Guys
Having this table,
I would like to get count of code per Group. (Code has unique values)
| Code | Group | Results I would like to get |
| 101 | Jeans | 2 |
| 102 | Jeans | 2 |
| 103 | Suits | 3 |
| 104 | Suits | 3 |
| 105 | Suits | 3 |
| 106 | Shoes | 1 |
Thanks
[# Codes per Group] = // measure var VisibleGroups = DISTINCT( T[Group] ) var Result = CALCULATE( COUNTROWS( T ), // T is your table's name VisibleGroups, ALLSELECTED( T ) ) return Result
2 Replies
- daXtremeSolution Sage
[# Codes per Group] = // measure var VisibleGroups = DISTINCT( T[Group] ) var Result = CALCULATE( COUNTROWS( T ), // T is your table's name VisibleGroups, ALLSELECTED( T ) ) return Result- MasterSonicHelper IV
Thank You