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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Discount count multiple tables

I have these two tables:

Assigment:

empid projid      

1011054
1011050
1031052
1071053
1021053
1041051

 

Projects:

projid  name   customer

1050SunPhilips
1051MoonASML
1052StarsASML
1053GalaxyDLL
1054MarsPhilips

 

As you can see, projid 1050 and 1054 and projid 1051 and 1052 have the same customer. I want to calculate the amount of projects an employee had for different customers, but if an employee has projid 1050 and 1054, it will count as 1 project. Does someone knows how to do this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mrstillchicken,

 

Here’s the sample data I used according to your description:

3.PNG4.PNG

Please check following steps as below and see if the result achieve your expectation:

1. Manage relationship between two tables:

1.PNG

2. Create measure:

    distinctcount = CALCULATE(DISTINCTCOUNT(Projects[customer]),FILTER(Assigment,Assigment[empid] = MAX(Assigment[empid])))

3. Result would be shown as below:

2.PNG

BTW, Pbix as attached. Hopefully works for you.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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 @mrstillchicken,

 

Here’s the sample data I used according to your description:

3.PNG4.PNG

Please check following steps as below and see if the result achieve your expectation:

1. Manage relationship between two tables:

1.PNG

2. Create measure:

    distinctcount = CALCULATE(DISTINCTCOUNT(Projects[customer]),FILTER(Assigment,Assigment[empid] = MAX(Assigment[empid])))

3. Result would be shown as below:

2.PNG

BTW, Pbix as attached. Hopefully works for you.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.