March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm trying to convert a tableau solution to Power BI and am ready to slam my computer against a wall. It seems that everything is harder than it needs to be.
I simply want to produce an "A" or "B" result based on a whole set of and/or conditions. Simple in Tableau or SQL but I can't make it work in Power BI / DAX. Open to any suggestions:
Here's what it looks like in Tableau - how do I do this in power BI??
IF ( [Employed] = 'F'
and (
([Current Status]) ='A'
OR ([Current Status]) ='B'
OR ([Current Status]) ='C'
OR ([Current Status]) ='D'
OR ([Current Status]) ='E'
))
OR
( [Employed] = 'T'
and (
([Current Status]) ='G'
OR ([Current Status]) ='H'
OR ([Current Status]) ='I'
OR ([Current Status]) ='J'
))
OR (([Current Status] ='E' and [Naics]<>'92'))
then 'BAD' else 'GOOD' END
Any help would be GREATLY appreciated!
Solved! Go to Solution.
Hi @TomGee ,
I'm assuming you are making a calculated column, try the following code:
Column = SWITCH ( TRUE (), Table[Employed] = 'F' && Table[Current Status] IN { 'A', 'B', 'C', 'D', 'E' }, "Bad", Table[Employed] = 'T' && Table[Current Status] IN { 'G', 'H', 'I', 'J' }, "Bad", Table[Current Status] = 'E' && Table[Naics] <> '92', "Bad", "GOOD" )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @TomGee ,
I'm assuming you are making a calculated column, try the following code:
Column = SWITCH ( TRUE (), Table[Employed] = 'F' && Table[Current Status] IN { 'A', 'B', 'C', 'D', 'E' }, "Bad", Table[Employed] = 'T' && Table[Current Status] IN { 'G', 'H', 'I', 'J' }, "Bad", Table[Current Status] = 'E' && Table[Naics] <> '92', "Bad", "GOOD" )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks so much!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |