Forum Discussion

AndrewDavies437's avatar
4 years ago
Solved

Getting a Count of data for each Employee (Need Dax help)

  If i have a table and one column will be the Employee name and another will be Product and the third the customer. For context we can say that the table records sales.   example: Employee  Prod...
  • DataInsights's avatar
    4 years ago

    AndrewDavies437,

     

    This solution uses a star schema:

     

     

    Create measure:

     

    Distinct Product Count = 
    SUMX ( Employees, CALCULATE ( DISTINCTCOUNT ( Sales[Product] ) ) )

     

    I added additional data to demonstrate that totals work. In a matrix, use Employees[Employee] as matrix rows.

     

     

  • DataInsights's avatar
    DataInsights
    4 years ago

    AndrewDavies437,

     

    You can create a calculated table which will enable you to create a star schema:

     

    Employees = DISTINCT ( Sales[Employee] )