Forum Discussion
Create a calculated column based on the values matching another table
- Anonymous6 years ago
I first load table A in a query:
and table B in another query (there is the column Company just to verify the expected result.
Then having tabB selected I add a new column via UI. The code is that you already have seen:
This is the result:
if you still have problems, in order to help you, you should post exactly all the steps you follow.
Hi,
Thank you for your response. I tried using it but I am getting an error. There is no relationship between the tables. I want to add a custom column in Table B. If ID of Table A matches id in Table B then it should populate as "A" or else populate as "Other".
Hi Anonymous you should put:
if List.Contains(tabA[ID],[ID]) then "A" else "Other"
in the UI add custom column to when table B is select.
- Anonymous6 years agoNot applicable
Hi Anonymous ,
I tried changing but it's still not working for me. In case you have a pbix file, could you please share it with me. May be I am still doing something wrong. I am trying to add this column in power query editor.
- Anonymous6 years agoNot applicable
I first load table A in a query:
and table B in another query (there is the column Company just to verify the expected result.
Then having tabB selected I add a new column via UI. The code is that you already have seen:
This is the result:
if you still have problems, in order to help you, you should post exactly all the steps you follow.