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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
OECvargoj
Frequent Visitor

Matching based on conditions

Hello,

 

I'm trying to display matching part numbers based on them having an opposite Stock Status. Using the example data below, I need a way to match Company A with Company B based on them both having Part Number 123ABC in their inventory while at the same time having opposite Stock Status.

 

CompanyPart NumberStock Status
A123ABCStock
B123ABCNo Stock
C456ABCNo Stock
D456ABCStock
E789XYZStock
F789XYZNo Stock
G741QWEStock
H741QWENo Stock

 

Does anyone have a solution for this?

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

What exact results are you expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@OECvargoj

 

Try this column for more than 1 match

 

Column =
CONCATENATEX (
    FILTER (
        ALL ( 'Table1' ),
        Table1[Part Number] = EARLIER ( Table1[Part Number] )
            && Table1[Stock Status] <> EARLIER ( Table1[Stock Status] )
    ),
    Table1[Company],
    ", "
)

 

BraneyBI
Kudo Commander
Kudo Commander

Assume the table is called "Table1", add a calculated COLUMN which will show the reciprocal company.

 

=CALCULATE( VALUES('Table1'[Company]),FILTER(ALL('Table1'),Table1[Part Number] = EARLIER(Table1[Part Number])&&Table1[Stock Status]<>EARLIER(Table1[Stock Status])))

 

 

Thank you @BraneyBI! The calculated column is working however, when I add more than 2 companies to my dataset, I get an error message. Is there any way to modify the calculated column to account for more companies and possibly more than one match?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.