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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JinjiNoDie
New Member

List missing information in new table

I have two tables with a M:M relationship. Whats the best way to determine if something is missing from the second table when comparing it to the first table? 

 

JinjiNoDie_0-1736269302273.png

 

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

To determine if something is missing in the second table compared to the first table in Power BI:

  1. Create Relationships: Establish a relationship between the two tables based on the common fields (e.g., Report Number and Item Number).

  2. Create a New Table: Use a DAX formula like the following to identify missing items:
    MissingItems =
    EXCEPT(
    SELECTCOLUMNS('FirstTable', "Report Number", 'FirstTable'[Report Number], "Item Number", 'FirstTable'[Item Number]),
    SELECTCOLUMNS('SecondTable', "Report Number", 'SecondTable'[Report Number], "Item Number", 'SecondTable'[Item Number]))

  3. Visualize the Output: Use a table visualization to display the MissingItems table, showing the Report Numbers and Item Numbers missing from the second table.

  4. This will directly list all missing combinations of report and item numbers.



View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello,rohit1991 ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hi,@JinjiNoDie .I am glad to help you.
If your two tables are guaranteed to look up the same columns, then you can try creating a virtual table that contains all the data from the table by using the except function on both virtual tables
like this.

vjtianmsft_0-1736301448111.png

The EXCEPT function is mainly used to compare two tables and return the rows that exist in the first table but not in the second. Note that the two tables must have the same number of columns, and the order and data types of the columns must match.


Create two virtual tables, _table1 and _table2, containing the Report Number and Item Number columns in the FirstTable and SecondTable, respectively. Then, use the EXCEPT function to return the rows that are in _table1 but not in _table2.
This gives you the flexibility to perform data lookups on the original tables without affecting the structure and data of the original tables.
Below is my test data:

vjtianmsft_1-1736301507765.png

FirstTable

Report Number

Item Number

25-1

1001

25-1

1002

25-1

1004

25-2

1001

25-3

1002

25-3

1003

25-4

1101

25-4

1102


SecondTable

Report Number

Item Number

25-1

1001

25-4

1102

25-1

1004

25-2

1001

25-3

1002

25-3

1003

vjtianmsft_2-1736301544620.png

 


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.


 

rohit1991
Super User
Super User

To determine if something is missing in the second table compared to the first table in Power BI:

  1. Create Relationships: Establish a relationship between the two tables based on the common fields (e.g., Report Number and Item Number).

  2. Create a New Table: Use a DAX formula like the following to identify missing items:
    MissingItems =
    EXCEPT(
    SELECTCOLUMNS('FirstTable', "Report Number", 'FirstTable'[Report Number], "Item Number", 'FirstTable'[Item Number]),
    SELECTCOLUMNS('SecondTable', "Report Number", 'SecondTable'[Report Number], "Item Number", 'SecondTable'[Item Number]))

  3. Visualize the Output: Use a table visualization to display the MissingItems table, showing the Report Numbers and Item Numbers missing from the second table.

  4. This will directly list all missing combinations of report and item numbers.



This did it for me. Thank you.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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