Forum Discussion
Help to use LIst.Contains()
- 7 years ago
Hi gpiero
It is easy with DAX,
Create a calculated column
Column = IF ( [Delivery Type] IN { "ZSDS", "ZSPD" } && [Customer Code] = 32, TRUE (), IF ( [Delivery Type] IN { "ZSDS", "ZSPD" } && [Customer Code] = 149 && [Code Add.Goods] IN { 1033, 1495, 32, 300001 }, TRUE () ) )Assume [Customer Code] and [Code Add.Goods] are of number type not text,
If they are text, replace [Customer Code] = 32 with [Customer Code] = "32",
[Code Add.Goods] IN { 1033, 1495, 32, 300001 } with [Code Add.Goods] IN { "1033", "1495", "32", "300001" }.
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi gpiero
It is easy with DAX,
Create a calculated column
Column =
IF (
[Delivery Type] IN { "ZSDS", "ZSPD" }
&& [Customer Code] = 32,
TRUE (),
IF (
[Delivery Type] IN { "ZSDS", "ZSPD" }
&& [Customer Code] = 149
&& [Code Add.Goods] IN { 1033, 1495, 32, 300001 },
TRUE ()
)
)
Assume [Customer Code] and [Code Add.Goods] are of number type not text,
If they are text, replace [Customer Code] = 32 with [Customer Code] = "32",
[Code Add.Goods] IN { 1033, 1495, 32, 300001 } with [Code Add.Goods] IN { "1033", "1495", "32", "300001" }.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Many thanks for solution.
Yes, it is clear, in DAX we can do in this way.
I only wanted to understand how to replicate the same in Power Query.
Thanks again