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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AlejandroPozo
Regular Visitor

Count different clients through data that appears several times in different tables

 
 

Hi everyone, I hope you can help me with this

 

I have a table that contains the information of the sellers with the products for which they are controlled

 

Table_control

cod_productcod_vendor
1405
2405
1123
1234
2678
3678


And another table that indicates the daily sales made by sellers.

 

Table_daily

cod_productcod_vendorcod_client
140512
112378
340523
240512
240532
212345
167867
267889
367867


I need to count the number of clients they visit based only on the products for which they are controlled

 

In this example the expected results would be the following:

 

cod_vendor# clients
4052
1231
6782
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

You need to add unique key column in both table which can be done using by concatenating vendor & product

 

so add column in both table like this:

 

Key = Control[cod_vendor] & Control[cod_product]

set relationship on this key betweem both tables

 

use table visual and drop, vendor from control table and cod_client from daily table, press arrow next to cod_client field in value deck, and choose distinct count

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

You need to add unique key column in both table which can be done using by concatenating vendor & product

 

so add column in both table like this:

 

Key = Control[cod_vendor] & Control[cod_product]

set relationship on this key betweem both tables

 

use table visual and drop, vendor from control table and cod_client from daily table, press arrow next to cod_client field in value deck, and choose distinct count

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

although based on your sample data, yo will not receive any thing from 678 since it is not in control table.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors