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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
talaespinosa
Frequent Visitor

Differences between two columns from different tables

Hello, I am trying to figure out how can I create a measure that list (and eventually counts its elements) the differences between two columns from different tables where certain filters were applied.
result from filter table 1:

3
85
86
719

result from filter table 2:

3
4
5
67
82
85
86
90

expected result 1:

4
5
67
82
90

expected result 2: 5 different elements
Thanks in advance!

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @talaespinosa 

It is recommended to use calculated table rather than mesaaure to display the result.

Please try formula like:
Calculated Table:

Result1 = 
 var filter1=SELECTCOLUMNS(FILTER(Table1,<filter1>&&<filter2>....),"column",Table1[Column1])
 var filter2=SELECTCOLUMNS(FILTER(Table2,<filter1>&&<filter2>....),"column",Table2[Column2])
 return  EXCEPT(filter2,filter1)

Measue:

Result2 = 
 var a1=COUNT(Result1[column])
 var b1=CALCULATE(DISTINCTCOUNT(Table2[Column2]),FILTER(Table2,<filter1>&&<filter2>))
 return b1-a1&":"&a1

If it doesn't work, please share a sample file for further research.

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @talaespinosa 

It is recommended to use calculated table rather than mesaaure to display the result.

Please try formula like:
Calculated Table:

Result1 = 
 var filter1=SELECTCOLUMNS(FILTER(Table1,<filter1>&&<filter2>....),"column",Table1[Column1])
 var filter2=SELECTCOLUMNS(FILTER(Table2,<filter1>&&<filter2>....),"column",Table2[Column2])
 return  EXCEPT(filter2,filter1)

Measue:

Result2 = 
 var a1=COUNT(Result1[column])
 var b1=CALCULATE(DISTINCTCOUNT(Table2[Column2]),FILTER(Table2,<filter1>&&<filter2>))
 return b1-a1&":"&a1

If it doesn't work, please share a sample file for further research.

Best Regards,
Community Support Team _ Eason

lbendlin
Super User
Super User

You are missing 719 from the first table.

 

Pseudo code:

 

UNION(EXCEPT(Table 1, Table 2),EXCEPT(Table 2, Table 1))

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors