Forum Discussion

MasterSonic's avatar
MasterSonic
Helper IV
3 years ago
Solved

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 ...
  • daXtreme's avatar
    3 years ago
    [# 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