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 |
Solved! Go to Solution.
Hello there @ConwayA ! 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
hi
you can also create a calculated column
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
Custom1
Hope this helps.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | ![]() |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. ![]() | Proud to be a Super User! | ![]() |
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
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.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | ![]() |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. ![]() | Proud to be a Super User! | ![]() |
I have not shared previously so not sure what you are asking for exactly. below is a screen shot of the report. the two colums exist in the All Employees table. the Leader of leaders table was the blank table I created and put the code into. but the code only built my example table again.
i need it to build from the All employees table so when it is update the leader of leader table updates as well.
The code I gave you was just an example of the "how".
The steps that matter are...
list = #"Changed Type"[Manager email]
This turns the Manager email column into a list for searching.
And the...
Custom1 = Table.AddColumn(#"Changed Type", "custom", each List.Contains(list, [submitter email]))
This uses the 'list' to search the submitter email.
Columns and steps will need to be renamed to suit obviously.
If you're still having issues, if you copy the code from the 'Advanced editor' for the "All Employees" table and paste it here, I'll be able to name the steps better. (make sure to obfuscate any sensitive data)
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | ![]() |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. ![]() | Proud to be a Super User! | ![]() |
Hello there @ConwayA ! 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