Forum Discussion
create custom column using one column as a list
I have a table with two columns Submitter email and Manager email. How would I create a custom column which will display TRUE if the submitter email is found anywhere in the Manager email.
as shown below. The submitter email could be anywhere in the Manager email or not at all.
| submitter email | Manager email | Leader of Leader |
| email 1 | email 8 | TRUE |
| email 2 | email 9 | TRUE |
| email 3 | email 1 | FALSE |
| email 4 | email 2 | FALSE |
Hello there Anonymous ! You can check if this works for you:
Leader of Leader = VAR _sub = SELECTEDVALUE ( [submitter email] ) VAR _list = DISTINCT ( [Manager email] ) RETURN IF ( _sub IN _list, TRUE (), FALSE () )Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
7 Replies
- goncalogeraldesSuper User
Hello there Anonymous ! You can check if this works for you:
Leader of Leader = VAR _sub = SELECTEDVALUE ( [submitter email] ) VAR _list = DISTINCT ( [Manager email] ) RETURN IF ( _sub IN _list, TRUE (), FALSE () )Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes - KNPSuper User
In Power Query (Transform data) paste the below code into the 'Advanced Editor' of a blank query.
let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText( "i45WSs1NzMxRMFTSgbIslGJ1YKJGcFFLJFFjBbiwIZKwCVzUSCk2FgA=", BinaryEncoding.Base64 ), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"submitter email" = _t, #"Manager email" = _t] ), #"Changed Type" = Table.TransformColumnTypes( Source, {{"submitter email", type text}, {"Manager email", type text}} ), list = #"Changed Type"[Manager email], Custom1 = Table.AddColumn(#"Changed Type", "custom", each List.Contains(list, [submitter email])) in Custom1Hope this helps.
- AnonymousNot applicable
I feel like I am missing something here. Like identifying the table I am pulling the new columns from.
so how do I make this happen from an existing table in my report.
For me the data is in the All Employee Table
- KNPSuper User
Can you show me the structure of the table in your report (without any sensitive data)?
And paste your existing Power Query code for that query?
I don't quite follow what you mean.
- AnonymousNot applicable
hi
you can also create a calculated columnColumn = IF(Sheet2[submitter email] in VALUES(Sheet2[Manager email]),TRUE(),FALSE())if this post helps, accept this as a solution