Forum Discussion

gssarathkumar's avatar
2 years ago
Solved

Column specific Exclusions in Calculated Column

I have a datatable which contains the data with below columns: Name Group Caller State Category Priority Type I also have an another table as below which I will be using as an Exclusion list....
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi gssarathkumar ,

     

    Your requirement is "AND(Name = Yes, Group = Yes), "Exclude" or AND(Name = Yes, Caller = Yes), "Exclude" or AND(Name = Yes, Category = Yes), "Exclude" or AND(Name = Yes, Priority = Yes), "Exclude" else "Include""?

     

    Is Yes a string or does it mean that the current column is not null? For example, "Group = Yes" means that the Group column is not null? I don't quite understand.

     

    In Power Query, it is convenient to create custom columns to achieve your needs.

     

    If it means that the current column is not null, the syntax is as follows:

    if [Name] <> Null.Type and ( [Group] <> Null.Type or [Caller] <> Null.Type or [State] <> Null.Type or [Category] <> Null.Type or [Priority] <> Null.Type) then "Exclude" else "Include"

     

    The same is true if it is a string, just change <> Null.Type to = "Yes".

     

    The page effect is as follows:

     

    After saving and exiting Power Query, add the newly created custom column to the Filter and set the condition to "is not Exclude".

     

    The final page effect is as follows:

     

    pbix file is attached.

     

    If you have any further questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!