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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gvg
Post Prodigy
Post Prodigy

List rows that are missing in another table

Hi experts,

I am looking for a way to list all rows of one table, that are missing in another table. Specifically I need to check one column in TableA if the value is missing in a column in TableB. If the value is missing I need to return the whole row of TableA. Here are my tables. I need to check if ProductID is missing in TableB. If it is missing - return that row which has missing ProductID.

 

TableA                                        TableB                                                ResultTable

ProductID  SalesAmount            ProductID    Price                               ProductID    SalesAmount            

123           100                            121             10                                  124             200

124           200                            122              50                                 125             150 

125           150                            123              20

 

How can I do this? Been trying to do it with EXCEPT, but it does not accept columns as parameters.

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @gvg

 

Add a New Table from Modelling Tab

Missing_IDs =
EXCEPT ( VALUES ( TableA[ProductID] ), VALUES ( TableB[ ProductID] ) )

Then Add a New Column in this New Table as follows

Sales =
CALCULATE (
    VALUES ( TableA[ SalesAmount] ),
    FILTER ( TableA, Missing_IDs[ProductID] = TableA[ProductID] )
)


This will give you desired table


Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

Hi @gvg

 

Add a New Table from Modelling Tab

Missing_IDs =
EXCEPT ( VALUES ( TableA[ProductID] ), VALUES ( TableB[ ProductID] ) )

Then Add a New Column in this New Table as follows

Sales =
CALCULATE (
    VALUES ( TableA[ SalesAmount] ),
    FILTER ( TableA, Missing_IDs[ProductID] = TableA[ProductID] )
)


This will give you desired table


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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