cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Unique ID Mismatch Detection

Hi guys,

 

There must be an obvious solution for this but maybe it is way more complicated than expected.

 

I have two tables linked by unique IDs such as : date + code + client name

 

Since both tables are normally updated everyday, everyday unique IDs are generated since the date changes (clarification, code + client name is itself always an unique combination)

 

However sometimes I do not have two files for the same date. In this scenario I need to ignore/delete the orphan rows; in order to get a clean relationship.

 

I guess this is something that has to be done on the Power Query Editor, or maybe with a DAX flag to detect IDs that do not match.

 

Any help would be much appreciated.

 

Thank you for your tips!

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Unique ID Mismatch Detection

Hi @MrFraga ,

 

Sorry for our delay in response, We can create a new calculated table to connect table B with 1 to 1 relationship:

 

New TableA = FILTER('TableA', var i = [ID] return CALCULATE(COUNTROWS('TableB'), 'TableB'[ID] = i)>0)

 

3.jpg4.jpg


If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared?

 

By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Unique ID Mismatch Detection

Hi @MrFraga ,

 

Sorry for that, but we cannot understand your data model clearly, Could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply? It will be helpful if you can show us the exact expected result based on the tables. Please upload your files to OneDrive For Business and share the link here.

 

What is the logic that you used to  delate rows, delete any rows that do not have a certain matched record in other table?

 

Such as following sample should delete row 1 in table 1 and row no 2 in table 2?

 

Table 1:

Row No.

Date

Code

Client name

1

2020-1-1

1

A

2

2020-2-1

2

B

3

2020-3-1

3

C

 

Table 2:

Row No.

Date

Code

Client name

1

2020-2-1

2

B

2

2020-4-1

1

A

3

2020-3-1

3

C

 

 

Please don't contain any Confidential Information or Real data in your reply.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Unique ID Mismatch Detection

 

Hello,

 

Let's assume that left table is generally updated everyday, while right one not. In my report, the source for each table is a folder where new files are placed "periodically". In this example; we can see that records from 28/03/2020 are missing in the right table.

 

Example.PNG

 

1) So in this case, given a one-to-one relationship, I would like to delete (= avoid loading) those rows from Left Table, 28/03/2020.

 

2) Alternatively I could create a calculated column to flag unmatched rows and the use it as an slicer (I guess).

 

3) Another solution would be joining tables (inner join) but I would like to avoid that, assuming there is a better way to clean the data.

 

Which one is the correct approach?

 

Thank you.

 

 

 

Highlighted
Community Support
Community Support

Re: Unique ID Mismatch Detection

Hi @MrFraga ,

 

Sorry for our delay in response, We can create a new calculated table to connect table B with 1 to 1 relationship:

 

New TableA = FILTER('TableA', var i = [ID] return CALCULATE(COUNTROWS('TableB'), 'TableB'[ID] = i)>0)

 

3.jpg4.jpg


If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared?

 

By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors