Forum Discussion
Anonymous
6 years agoNot applicable
Comparing two tables to find differences
I have 2 tables that should, in theory, be identical; Table 1 agentID Date Ringtime Talktime ConnectionID HoldTime 1 26/09/2019 12 124 CID15789 0 2 26/09/2019 5 452 CID782...
- 6 years ago
Hi Anonymous ,
We can create a calculated column In TableA using following formula to meet your requirement:
IsDifferentFromTableB = IF ( COUNTROWS ( FILTER ( 'TableB', [agentID] = EARLIER ( [agentID] ) && [Date] = EARLIER ( [Date] ) && [Ringtime] = EARLIER ( [Ringtime] ) && [HoldTime] = EARLIER ( [HoldTime] ) && [ConnectionID] = EARLIER ( [ConnectionID] ) && [Talktime] = EARLIER ( [Talktime] ) ) ) + 0 > 0, "NO", "YES" )Also you could create in TableB:
IsDifferentFromTableA = IF ( COUNTROWS ( FILTER ( 'TableA', [agentID] = EARLIER ( [agentID] ) && [Date] = EARLIER ( [Date] ) && [Ringtime] = EARLIER ( [Ringtime] ) && [HoldTime] = EARLIER ( [HoldTime] ) && [ConnectionID] = EARLIER ( [ConnectionID] ) && [Talktime] = EARLIER ( [Talktime] ) ) ) + 0 > 0, "NO", "YES" )
BTW, pbix 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.
Nathaniel_C
6 years agoCommunity Champion
Hi Anonymous ,
Start at the bottom, merge the two tables, I used ID, then expand the second table using the table name as a prefix, except don't need ID, then the if statement which checks all matches and flags.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel