Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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"
Solved! Go to Solution.
Please try
Switch (true(),
[ACCOUNTNUM] in { "B30001","B34123"} && [Amount]>0 , "Reversal" ,
[ACCOUNTNUM] in {"B30002","B12323"} && [Amount]>0 , "Release",
"Accrual"
)
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
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!
Hi Maggie. Now I have this issue above.
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” ,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
60 | |
58 | |
54 | |
36 | |
33 |
User | Count |
---|---|
79 | |
66 | |
45 | |
44 | |
42 |