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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Jodownunder_
New Member

Find values that are on the many side of a relationship but not on the "one" side

Hi,
I feel like this is an easy question but I've been going around in circles so thought I'd try the brains trust.
I have 2 tables with a one to many relationship.
In table 1 its one order per line but in table 2 there could be several lines with the same order number depending on how many different products are on the order. 
Table 1 (one side) Orders from one system
Table 2 (many side) All orders in a production system

Employees can also enter orders manually directly into production system (table 2) so I'm trying to find the DAX to see if there are any current orders in table 2 that are not in table 1. I can look in table 1 for orders not in table 2 but not the other way around. 
Any help apreciated.
Thanks,

Jo

4 REPLIES 4
divyed
Resolver III
Resolver III

Hello @Jodownunder_ ,

 

You can try below dax to add a calculated column in table 2 .

 

NotInTable1 =
IF(
ISBLANK(
LOOKUPVALUE(
Table1[OrderID],
Table1[OrderID],
Table2[OrderID]
)
),
TRUE,
FALSE
)

 

Alternatively you can create a measure as well :

 

OrdersNotInTable1 =
COUNTROWS(
FILTER(
Table2,
ISBLANK(
LOOKUPVALUE(
Table1[OrderID],
Table1[OrderID],
Table2[OrderID]
)
)
)
)

 

I hope this helps .

 

Did I answer your query ? Mark this as solution so that other members can find this quickly. Kudos are appreciated.

 

Cheers

FreemanZ
Super User
Super User

hi @Jodownunder_ 

 

try like:

 

1. plot a table visual with table2[order] column, do not aggregate.

2. pull table2[order] to the filter pane of the table visual and select blank.

 

then you shall see all the orders kissing in table1.

Jodownunder_
New Member

Thanks but that doesn't work - it just shows all the ones in table 2 saying "Yes" that have a match but doens't show any with "no". And I know there are some!

 

isjoycewang
Super User
Super User

Hi @Jodownunder_,

 

I'd try to make a demo based on your description. Please try below column:

 

In_Table1 = 
IF( Table2[OrderID] IN VALUES(Table1[OrderID]), "Yes", "No")

 

 

isjoycewang_0-1731637793145.png

Please provide a dummy file sample if the demo situation doesn't work for you. Thanks.

 

Best Regards,

Joyce

 

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors