The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a column A and column B. I want to add new column C like-
if coulmn B contains specific text1 and column A contains another specific text2 then put text X in column C else if coulmn B contains specific text3 and column A contains another specific text4 then put text Y in column C else if coulmn B contains specific text5 and column A contains another specific text6 then put text Z in column C and so on.
Can some one please help me with the formula?
Solved! Go to Solution.
hi @Ramendra
In edit queries, you could use the logic of this formula:
if( Text.Contains([Column A],"text1") and Text.Contains([#"Column B#(lf)"],"text2"))
then "X"
else if( Text.Contains([#"Column B#(lf)"],"text3") and Text.Contains([Column A],"text4"))
then "Y"
else if( Text.Contains([#"Column B#(lf)"],"text5") and Text.Contains([Column A],"text6"))
then "Z"
else null
and here is sample pbix file, please try it.
Regards,
Lin
hi @Ramendra
In edit queries, you could use the logic of this formula:
if( Text.Contains([Column A],"text1") and Text.Contains([#"Column B#(lf)"],"text2"))
then "X"
else if( Text.Contains([#"Column B#(lf)"],"text3") and Text.Contains([Column A],"text4"))
then "Y"
else if( Text.Contains([#"Column B#(lf)"],"text5") and Text.Contains([Column A],"text6"))
then "Z"
else null
and here is sample pbix file, please try it.
Regards,
Lin
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
78 | |
66 | |
52 | |
51 |
User | Count |
---|---|
121 | |
116 | |
77 | |
64 | |
63 |