Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to look across a couple of columns to determine if a condition is true then report out "Premix". I'm new to PQ and figuring out this type of syntax. Appreciate any assistance.
= if [Medication Name] Text.Contains "minibag" then "Premix" or if [Medication ERX ID] <> 27838 or [Medication ERX ID] <> 9364) then "Premix"
I also tried this initially and it did not work, possibly different arguments needed.
= if [Medication Name] does not contain "minibag" or if [Medication ERX ID] <> 27838 or [Medication ERX ID] then "Premix"
Solved! Go to Solution.
Hi @lepettit ,
Your syntax should be something like this:
if Text.Contains([Medication Name], "minibag") then "Premix"
else if not List.Contains({27838, 9364}, [Medication ERX ID]) then "Premix"
else //your escape clause, like null, "error" etc.
Pete
Proud to be a Datanaut!
A slightly different way would be (you can replace null appropriately)
= if Text.Contains([Medication Name],"minibag") or not List.Contains({27838,9364},[Medication ERX ID]) then "Premix" else null
Thank you, this worked 🙂
A slightly different way would be (you can replace null appropriately)
= if Text.Contains([Medication Name],"minibag") or not List.Contains({27838,9364},[Medication ERX ID]) then "Premix" else null
Hi @lepettit ,
Your syntax should be something like this:
if Text.Contains([Medication Name], "minibag") then "Premix"
else if not List.Contains({27838, 9364}, [Medication ERX ID]) then "Premix"
else //your escape clause, like null, "error" etc.
Pete
Proud to be a Datanaut!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.