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
Sha
Helper II
Helper II

Count where doesn't exist

I'm struggling to find solution:  I have data on 1 row (company, product).  I am wanting to pick a product and show all the companies that have NOT bought this product.  I also only want to see the companies that have sold 2 or more products.

 

Data:

Company A   Product 1

Company A  Product 2

Company A  Product 3

Company B  Product 2

Company C  Product 2

Company C Product 3

Company D  Product 2

Company D Product 3

 

Result needed:  I want to be able to select a product ( Product 1)  and see list of companies that could still be sold Product 1:

Company C

Company D

I don't want to see Company B because it hasn't been sold 2 or more products.

I then would also like to count how many companies that I could sell Product 1 to, which would be 2.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Sha 

 

You may take a look at the posts below.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Sha ,

One way to get if you have company Dimension

Except(Company[Company],table[Company])

 

Other is create a measure and then use nest two measures for your two requirements
measure = count(Table[Product])+0

Filter measure =calculate(sumx(value(company[company]),[measure]),filter(Table,[measure]=0))

Filter measure 2 =calculate(sumx(value(company[company]),[measure]),filter(Table,[measure]>=2))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I created 2 measures but Value didn't work in 2nd measure, should I be using Values?  It didn't produce any results.

Product cnt = count(Sheet1[Product])+0  (when I created matrix, 0 didn't show up)
Company Cnt = CALCULATE(SUMX(values(Sheet1[Company]),[Product cnt]),FILTER(Sheet1,[Product cnt]=0)) (when I created table for Company, Company Cnt  nothing showed up)
Capture.PNG
 
 
 

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!

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.