Forum Discussion
SCHOOL ASSIGNMENT: Multiple conditions in an conditional column
- Anonymous3 years ago
We've managed to solve this challenge with the following formula:
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving], "serie") and [VOORRAAD_Aantal] > 10 then 10 else [VOORRAAD_Aantal])
Hi -
Don't think you need to nest the if statements, you can just use an "and" in the if-clause eg:
= Table.AddColumn(Source, "Custom", each if [Col1] = "Val1" and [Col2] = "10" then "Some Val" else "Some Other Val")
Cheers,
Peter
Hi Peter_Beck ,
Thank you for your help, I've tried this formula but it returns a column full of errors. I've tried it in several ways none of them did work:
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving] = "serie" and ([VOORRAAD_Aantal]) > "10") then 10 else [VOORRAAD_Aantal])
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving] = "serie" and [VOORRAAD_Aantal] > "10") then 10 else [VOORRAAD_Aantal])
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving] = "serie" and ([VOORRAAD_Aantal]) > "10" then 10 else [VOORRAAD_Aantal])
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving] = "serie" and ([VOORRAAD_Aantal]) > "10" then 10 else ([VOORRAAD_Aantal]))
= Table.AddColumn(#"Renamed ALG_VerkoopPrijsExcl new", "Custom", each if Text.Contains([ALG_Omschrijving] = "serie" and [VOORRAAD_Aantal] > "10" then 10 else [VOORRAAD_Aantal])
Thank you again anyways.
Rg,
Shadi