Forum Discussion
how to make conditional column using two tables with reference to another table
- Anonymous2 years ago
Hi Nicks612 ,
Please try using merge queryand then transform the New Status column.
In the simulated data, there will be the case of matching to more than one status, here I assume that there is "OK" in the status to return "OK", otherwise return "NG".
Please check the pbix file.Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hello guys,
tackytechtom and AlienSx
sorry for the inconvenience!! there is some change in the previous data query. Please find the updated doubt.
I have two tables: table A and table B as shown below.
I want to make a conditional column in Table B with reference to Table A which contains OK and Nok data.
Table A contains:
| Sr.No | Status | DBKey |
| 123456 | OK | 20230503092547 |
| 123456 | NG | 20230503084725 |
| 123456 | OK | 20230503070939 |
| 235678 | NG | 20230508100137 |
| 132456 | NG | 20230524172714 |
| 132456 | OK | 20230527141557 |
| 165478 | OK | 20230514120545 |
| 765432 | NG | 20230507130646 |
| 765432 | NG | 20230507131046 |
Table B contains:
| Sr.No | DBKey |
| 123456 | 20230503084725 |
| 235678 | 20230508100137 |
| 132456 | 20230527141557 |
| 765432 | 20230507131046 |
Result table B be like:
| Sr.No | DBKey | New Status |
| 123456 | 20230503084725 | NG |
| 235678 | 20230508100137 | NG |
| 132456 | 20230527141557 | OK |
| 765432 | 20230507131046 | NG |
Can you help me out with this problem? I have tried with the DAX lookup formula and succeeded but need to do it with the power query editor.
- Anonymous2 years agoNot applicable
Hi Nicks612 ,
Please try using merge queryand then transform the New Status column.
In the simulated data, there will be the case of matching to more than one status, here I assume that there is "OK" in the status to return "OK", otherwise return "NG".
Please check the pbix file.Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
- Nicks6122 years agoHelper I
Thanks a lot for the prompt response!