Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Switch true expression not working

Hi all I am a new Power BI user, I am trying to use Switch true expression, I am getting the following error for the expression in power query.   My query is = Table.AddColumn(#"Added Custom", "P...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous,

     

    I have modified your custom column syntax try this

     

    = Table.AddColumn(Source, "PIPING-INT", each if Text.Contains([#"SAP Task-3"], "PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else if Text.Contains([#"SAP Task-4"], "PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else if Text.Contains([#"SAP Task-5"], "PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else if Text.Contains([#"SAP Task-6"], "PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else if Text.Contains([#"SAP Task-7"],"PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else if Text.Contains([#"SAP Task -8"],"PIPING") and Text.Contains([#"SAP Task-2"], "INT") then "PIPING-INT" else "False")  

     

    Thanks

    Lavdeep