Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BiJoe
Helper II
Helper II

How to count facts from two dimensions?

This count of sales per employee per product should be really simple, but I have not found a simple way to do this in DAX. Appreciate any guidance to make a measure in the sales fact table. All tables are modeled in a star schema.

 

Employee dimension

PK EmployeeName
1Jane
2Joe
3Alice

 

Product dimension

PK ProductProduct name
1Wrench
2Gadget
3Clack

 

Sales fact table

FK EmployeeFK Product
11
22
22
33

 

Expected table visual

EmployeeProductNumber of sales
JaneWrench1
JoeGadget2
AliceClack1

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @BiJoe 

 

Based on your information, here is my model relationship.

vyohuamsft_0-1707988735808.png

 

I create a new measure named Number of sales

 

vyohuamsft_1-1707988735813.png

 

Here is my DAX:

Number of sales = COUNT('Sales fact table'[FK Employee])

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @BiJoe 

 

Based on your information, here is my model relationship.

vyohuamsft_0-1707988735808.png

 

I create a new measure named Number of sales

 

vyohuamsft_1-1707988735813.png

 

Here is my DAX:

Number of sales = COUNT('Sales fact table'[FK Employee])

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors