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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-jayw-msft
Community Support
Community Support

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.