Forum Discussion
Compare values in table
If the country column is unqiue in both tables, you can create relationship between the two tables using the Country column
Then in one of the tables you can add a calculated colum that uses logic to compare the two.
The calculation below is one you might add to Table1.
Difference Column =
RELATED('Table2'[Value]) - 'Table1'[Value]
I have a simple PBIX file here that shows the technique
Hi Phil,
Thanks for your demo. It has been helpful. I tried your method, but I am having some issue getting it work in my situation. I am creating the difference variable in BRPrintxx table. I wonder if it is because of the Country table in the middle. Please let me know if you have any idea. Thanks a lot.
- v-xjiin-msft8 years agoSolution Sage
Hi ChenChristyYu,
Generally even there's a Country table in the middle of the relationship. It will not affect the result.
Then based on your screenshot, it seems like you are using a measure. You should know that we cannot call a column directly in a measure. So please try calculated column instead of using measure.
By the way if the country code is unique in both tables. Why don't you just create a relationship between the two tables?
Thanks,
Xi Jin.