Switching measure from Tableau to PowerBI HELP!

I am transitioning a Tableau Dashboard over to Power BI and am newer to using DAX. I need to create this same type of measure or calculated column into PowerBI.

So far I have tried using containsstring with an if statement and can get it to work with one option, but when I try adding other selections it doesn’t work.

image

Tableau Measure
CARES / Unapplied / Forward Balance / Interest Payment
IF [Pat First Name] == “BONUS”
THEN “CARES CR”
ELSEIF
CONTAINS(UPPER([Pat Last Name]),“UNAPPLIED”) OR
CONTAINS(UPPER([Pat First Name]),“UNAPPLIED”) OR
CONTAINS(UPPER([Pat Last Name]),“UNALLOCATED”) OR
CONTAINS(UPPER([Pat First Name]),“UNALLOCATED”) OR
UPPER([Pat First Name]+" “+[Pat Last Name])==“TOS 2021 UNKNOWN” OR
UPPER([Pat First Name]+” "+[Pat Last Name])==“UNKNOWN PAYMENTS” OR
CONTAINS(UPPER([Pat Last Name]),“RECEIPTS”) OR
(
UPPER([Pat First Name])==“TRANSACTION” AND
UPPER([Pat Last Name]) IN (“2021”,“FEES 2021”)
) OR
(
UPPER([Pat First Name])==“ACCOUNT” AND
CONTAINS(UPPER([Pat Last Name]),“ZZ”)
) OR
(
UPPER([Pat First Name])==“UNK” AND
UPPER([Pat Last Name]) IN (“BULK EFT”,“AETNA”,“UHC”)
)
THEN “Unapplied”
ELSEIF
CONTAINS(UPPER([Pat Last Name]),“INTEREST”)
THEN “Interest Payment”
ELSEIF
CONTAINS(UPPER([Pat Last Name]),“FORWARD BALANCE”)
THEN “Forward Balance”
END

Any help would be greatly appreciated!!

Well this is the code I ended up using and it seems to be working… Not sure if there was a faster way, but at least it is working!

Hi @carlinlentz

I noticed you didn’t provide a PBIX file. Providing one will help users and experts find a solution to your inquiry faster and better.

A perfect initial question includes all of the following:

  • A clear explanation of the problem you are experiencing
  • A mockup of the results you want to achieve
  • Your current work-in-progress PBIX file
  • Your underlying data file (to allow us to go into Power Query if necessary to transform your data and/or data model – often DAX questions really end up being data modeling solutions)

Check out this thread on Tools and Techniques for Providing PBIX Files with Your Forum Questions

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Not completing your data may sometimes cause delay in getting an answer.

Thank you!

Bumping this post for more visibility from our experts and users.

Hi @carlinlentz,

Due to inactivity, we’d like to conclude that your inquiry was out of the experts and users’ bounds.

If you were sure you provided all pertinent context to your concerns and read how to use the forum more effectively and still find your question unanswered, your membership also comes with relevant resources that may help you with your Power BI education, so we advise that you check these resources as well.

While our users and experts do as much as reasonable to help you with your inquiries, not all concerns can be attended to especially if there are some learnings to be done. Thank you!

No file- but I think a combination of IF logic and SWITCH statement could possibly work?