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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.