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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
valerial
Helper I
Helper I

Multiple conditions in a column dax

I am trying to select multiple values within one text and write mulitple ifs within one column something like this..

 

but this does not work how do i do this

if ([ACCOUNTNUM] = “B30001,B34123” and [Amount]>0 then “Reversal”

else if[ACCOUNTNUM] = “B30002,B12323” and [Amount]>0 then "Release"
else “Accrual"

1 ACCEPTED SOLUTION

Hi @valerial 

Please show your error.

Capture6.JPG

Best Regards

Maggie

View solution in original post

9 REPLIES 9
amitchandak
Super User
Super User

@valerial ,

Please try

Switch (true(),
[ACCOUNTNUM] in { "B30001","B34123"} && [Amount]>0 , "Reversal" ,
[ACCOUNTNUM] in {"B30002","B12323"} && [Amount]>0 , "Release",
"Accrual"
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
v-juanli-msft
Community Support
Community Support

Hi @valerial 

Try columns below:

Column =
IF (
    [ACCOUNTNUM]
        IN {
        "B30001",
        "B34123"
    }
        && [Amount] > 0,
    "Reversal",
    IF (
        [ACCOUNTNUM]
            IN {
            "B30002",
            "B12323"
        }
            && [Amount] > 0,
        "Release",
        "Accrual"
    )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Maggie,

Your solution showed an error in the In

Hi @valerial 

Please show your error.

Capture6.JPG

Best Regards

Maggie

errorpowerbi.jpg

Hi @valerial 

I don't see column name in the left of the "=", it should be there.

also, you need add one more ")" at the end of the formula.

 

Best Regards

Maggie

Maggie I had some silly typo! it works thank you!

powerbierror.JPG

 

Hi Maggie.  Now I have this issue above.  

HotChilli
Community Champion
Community Champion

The code has to be very explicit with the logic test

If I was you , I would get the account code bit working first then introduce the balance test.

Is this an 'OR' test?

if ([ACCOUNTNUM] = “B30001" OR [ACCOUNTNUM] = "B34123” ,


Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.