Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Creating a custom column with multiple TRUE responses

Beginner user to powerbi/power query....I am trying to create a custom column which returns true or false when two separate columns both equal "true".  e.g. "if [column1] OR [column2] = "true" then ...
  • Fowmy's avatar
    2 years ago

    Anonymous 

    If you can use the following method as well in a new custom column, it evaluates to True when both the columns are true:

    [Column1] and [Column2]

     

  • BA_Pete's avatar
    BA_Pete
    2 years ago

    Hi Anonymous ,

     

    I think this is probably due to your column formats. I've assumed they are text format as your example stated "true" as the condition.

    If the columns to be evaluated are actually boolean data type, then you can use the shortcut that Fowmy has suggested, something like this:

    if [Column1] or [Column2] then "true"
    else "false"

     

    The above will output text values. If you want to output actual boolean type, then just remove the quote marks from the output values:

    if [Column1] or [Column2] then true
    else false

     

    Pete