Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Chanise89
Helper I
Helper I

Tableau Formula translated into DAX

HI all,

 

I have been trying to translate this Tableau formula into a DAX expression but it keeps failing. 

 

Can someone help?

 

if CONTAINS( [Acc Level 1 Des],"Oper") and CONTAINS([Acc Level 2 Des],"Misc") then [Acc Level 3 Des]

ELSEIF CONTAINS( [Acc Level 1 Des],"Oper") and CONTAINS([Acc Level 2 Des],"Head") then [Acc Level 3 Des]

ELSEIF CONTAINS([Acc Level 3],"E7421") then [Acc Level 3 Des]

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Chanise89 Try:

Column = 
  SWITCH(TRUE(),
    FIND("Oper",[Acc Level 1 Des],,-1) > -1 && FIND("Misc",[Acc Level 2 Des],,-1)>-1, [Acc Level 3 Des],
    FIND("Oper",[Acc Level 1 Des],,-1) > -1 && FIND("Head",[Acc Level 2 Des],,-1)>-1, [Acc Level 3 Des],
    FIND("E7421",[Acc Level 3],,-1) > -1, [Acc Level 3 Des]
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Chanise89 Try:

Column = 
  SWITCH(TRUE(),
    FIND("Oper",[Acc Level 1 Des],,-1) > -1 && FIND("Misc",[Acc Level 2 Des],,-1)>-1, [Acc Level 3 Des],
    FIND("Oper",[Acc Level 1 Des],,-1) > -1 && FIND("Head",[Acc Level 2 Des],,-1)>-1, [Acc Level 3 Des],
    FIND("E7421",[Acc Level 3],,-1) > -1, [Acc Level 3 Des]
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you Greg. Sorry I left off some of the formula... Here is the entire thing:

 

if CONTAINS( [Acc Level 1 Des],"Oper") and CONTAINS([Acc Level 2 Des],"Misc") then [Acc Level 3 Des]

ELSEIF CONTAINS( [Acc Level 1 Des],"Oper") and CONTAINS([Acc Level 2 Des],"Head") then [Acc Level 3 Des]

ELSEIF CONTAINS([Acc Level 3],"E7421") then [Acc Level 3 Des]
else [Acc Level 2 Des]
END

 

It would essentially be the same right?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.