Forum Discussion
AndrewDavies437
Helper I
4 years agoGetting 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...
- 4 years ago
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.
- 4 years ago
You can create a calculated table which will enable you to create a star schema:
Employees = DISTINCT ( Sales[Employee] )
DataInsights
Super User
4 years ago
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.
AndrewDavies437
Helper I
4 years agoI can't arrange my data into a star schema. Both the product and employees columns are in the same table. Do you still think this is possible?
- DataInsights4 years ago
Super User
You can create a calculated table which will enable you to create a star schema:
Employees = DISTINCT ( Sales[Employee] )- AndrewDavies4374 years ago
Helper I
Thank you so much. This really helped me. Have a great day 🙂
- DataInsights4 years ago
Super User
You're welcome! Glad to hear it worked. 🙂