Forum Discussion
power query IF statement help
how to write a formula in powerbi for "if a column from my current table equals to a column in another table then its xxx if not xxx"?
I can't do conditional column becase the two columns are in two different tables.
I'm trying to use the custom column to do this.
Any help would be appreacited
thanks!
- Anonymous4 years ago
Hi fbostan1 ,
My Sample is as below.
Table1:
Table2:
Custom column:
if List.Contains(Table2[Column1],[Column1]) = true then "Y" else "N"Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- parry2kSuper User
fbostan1 well, you have to merge these two tables together on a common key, expand the column you need from the 2nd table, and then write the if condition and remove the unwanted columns.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- fbostan1Helper I
I can't figure out how to merge this two column from two different table into one column.
- Ashish_MathurSuper User
Hi,
You can merge 2 tables on the basis of at least 1 common column between 2 tables.
- parry2kSuper User
fbostan1 it will be easier if you put a sample data of both tables in excel sheet and the expected output, and share it using one drive/google drive and try to put something together for you.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- AnonymousNot applicable
Hi fbostan1 ,
My Sample is as below.
Table1:
Table2:
Custom column:
if List.Contains(Table2[Column1],[Column1]) = true then "Y" else "N"Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.