Search code examples
ssaspowerbidaxpowerpivotssas-tabular

New calculated table in DAX order by the count


I am using SSAS Tabluar models and I am trying to create a calculated table based on the count of each subcategory.

ColumnA     ColumnB
SPN100      new
SPN100      old
SPN100      new
SPN200      new
SPN200      old

and I am trying to create a new table based on counts of ColumnB

Column A    Counts 
SPN100       3
SPN200       2

Solution

  • You can use SUMMARIZE or SUMMARIZECOLUMNS.

    Summary = SUMMARIZE(Table, Table1[ColumnA], "Counts", COUNT(Table1[ColumnB]))
    
    Summary = SUMMARIZECOLUMNS(Table1[ColumnA], "Counts", COUNT(Table1[ColumnB]))