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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
waly01
Regular Visitor

How to count the number of names within a category in a table

Hi, 

 

I have 2 tables. One table is laid out with a Company name in one column and a total items sold in another column. 

 

I have a second table that just has Client who purchased the item and the amount it purchased. 

 

So, If I click on a company name in the one table, the second table will show me a list of all the clients who pruchsed that item from that company. 

 

I want to add a column that shows the count of the clients who purchased the item to my first table. So, Next to the company name, I can see 5 and know that there are 5 different clients who purchsed it. Then, if I click that Company name, the 2nd table will now show me the name of each client and amount purchased. 

 

Thanks so much!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @waly01,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also try to use the following formula if it helps:

 

Client Count =
CALCULATE (
    COUNTROWS ( VALUES ( Table2[Client] ) ),
    FILTER ( Table2, [Cpmpany] = EARLIER ( Table1[Cpmpany] ) )
)

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @waly01,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

In addition, you can also try to use the following formula if it helps:

 

Client Count =
CALCULATE (
    COUNTROWS ( VALUES ( Table2[Client] ) ),
    FILTER ( Table2, [Cpmpany] = EARLIER ( Table1[Cpmpany] ) )
)

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors