Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I am looking for a way to create a calculated column called "Matching" where it compares Column B against column A.
The output I am looking for is column D.
I have tried doing Text.Contains function but not expecting the results I need.
Looking for the best way to do this in either Power Query or within the Data Model!
Thank you!
Solved! Go to Solution.
Hi @Powebiguru2 ,
Please try this custom column in Power Query.
= if List.Contains(Text.Split([App Approvers], ", "), [Approver]) then "True" else "False"
This formula uses the Text.Split function to split the values in Column App Approvers into a list, and then uses the List.Contains function to check if the value in Column Approver is in the list. If it is, the formula returns "True". If it isn't, the formula returns "False".
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Powebiguru2 ,
Please try this custom column in Power Query.
= if List.Contains(Text.Split([App Approvers], ", "), [Approver]) then "True" else "False"
This formula uses the Text.Split function to split the values in Column App Approvers into a list, and then uses the List.Contains function to check if the value in Column Approver is in the list. If it is, the formula returns "True". If it isn't, the formula returns "False".
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please post the Power Query code you have tried.
= if Text.Contains([Approver],[App Approver]) then "True" else "False"
Hi @Powebiguru2,
Give this a go. You can copy this script into a new blank query.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sovzkxVCM7NLMnQUfBKLM7NzEPiJmdD2Eo6Skic2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"App Approvers" = _t, Approver = _t]),
AddMatching = Table.AddColumn(Source, "Matching", each Text.Contains([App Approvers], [Approver]), type logical)
in
AddMatching
with this result.
Ps. If this helps solve your query please mark this post as Solution, thanks!
This solution results in "True" for all the rows.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |