I am trying to create some logic that uses an iif statement with multiple conditions. Below is what I am currently using. However, it doesn't appear to work when I check the Power BI platform. Any advice would be greatly appreciated.
I tried using uppercase(destination_city) to fix the case issue but it didn't work. I then used a data cleansing tool as well and it still won't fix the case. Any ideas on how to correct the case would be greatly appreciated as well. I don't know if that is causing the logic to fail.
The Logic i am using
iif([destination_city] = "Alburtis" || "HASLET" || "Rialto" , "DC Transfer", "Non DC Transfer")
The result i am getting in Power BI is this. I am getting duplicates and incorrect results
Solved! Go to Solution.
can you please share dataset in excel and also workflow if possible
Hi @czjames87
I'd standardize the case in the field, just to ensure that they can find a match. I'm assuming that you're using Data
Cleansing to remove any extra spaces or non-text characters.
You could try: IIF([destination_city] In ("Alburtis" ,"HASLET" ,"Rialto") , "DC Transfer", "Non DC Transfer")
Or a much longer way:
IF Contains([destination_city], "Alburtis") OR Contains([destination_city], "HASLET") OR Contains([destination_city], "Rialto") THEN "DC Transfer"
ELSE "Non DC Transfer"
ENDIF
Let me know if either work for you.
Cheers!
Esther
Let me know if that works
Cheers!
Esther
the last one worked like a charm. thank you so much for your help.