Forum Discussion

Aweklin's avatar
Aweklin
New Member
9 years ago
Solved

How to group data on table

Hello,   How do I display Product Categories and Product Count Against each category in a tabular format?   Just like writing   SELECT c.Name AS Category, Count(p.ID) AS ProductCount FROM Cate...
  • Phil_Seamark's avatar
    9 years ago

    Hi Aweklin

     

    If your datasource is an SQL datasource then you can just run this SQL as your query into your table and let the DB Engine do the grouping.  Otherwise you can do this both in the Query Editor and in DAX.

     

    In DAX the forumla will look something like :

     

    New Table = SUMMARIZE ( '<your table>' , [Name] , "ProductCount" , COUNTROWS('<your table>') )