Tableau does a row level comparison of your data source.
Row | Column A | Column B | Match?
1 | F | J | N
2 | K | K | Y
3 | M | F | N
The calculation could be as simple as:
If [Column A] == [Column B] then 'True' Else 'False' END
If you're looking to compare row 1 to row 3, it would fail. Could you explain your logic behind wanting to compare certain rows to other rows? I may be able to lend some guidance on data structure.