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
thmonte
Helper IV
Helper IV

Comparing columns from two different tables that have relationships and show differences only

So I am looking for some assistance creating a discrepancy report.  I have two databases that should always be in sync with each other and I am going to be using PowerBI to spot check this.  The databases are not completely matching but with some reference data I was able to create relationships to get what needs to be check into one visual.  The end goal is to have one visual that disables all related rows that are out of sync with each other and possibly highlight the differences.

 

 

So what the visual looks like now is this, there is one more column that is not showing here that makes each of these rows unique.  What I am looking to do is compare A1 to B1 and if they do not equal each other show the differences.  I am assuming I can create a new table that stores only the differences and show the entire table in a visual?  I've done some searching and I've seen recommendations on using DAX RELATED but I can't seem to get that working.  Remember I have created reference data that is used to tie the two tables together.  Any help is greatly appreciated!  Thanks.

 

 

table_visual.jpg

3 REPLIES 3
CahabaData
Memorable Member
Memorable Member

please clarify: you state & display a visual where both A1 & B1 are together already.  

 

so you do have the 2 tables joined it appears

 

if this is the case you can create a measure 

Different Flag = if (A1 <> B1, 1, 0)

 

this measure should work in the same visual, putting a 1 where they differ.  One could then apply a page level filter of just 1s for this field/column

 

 

 

 

www.CahabaData.com

@CahabaData I'm having a hard time getting the proper formula to work

 

VAR __BASELINE_VALUE = COUNTA(table1[A1])
VAR __VALUE_TO_COMPARE = COUNTA(table2[B1])
RETURN
	IF(__BASELINE_VALUE <> __VALUE_TO_COMPARE,"T","F")

This is what I tried but it is not returning the right results.  It looks like its adding the numbers.

Thats a pretty interesting solution and it might work.  I was able to get it all in the same visual by creating relationships between the two tables using reference data.  How can I create the measure to pull in the value across two seperate tables?

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.