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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

if statement with AND construction

hi

 

want to use a simple statement but in the advanced editor of query editor i seems to be missing something....

this is what i have:

Account groups= 999999, 90000 and 87000 plus we have an costcenter in range 240, 200, 250, 300, 270, 777

so if the Account group is 999999 AND the costcenter is in range of 200, 240, 270 then B1. Automatic else NULL

Tried this so far, unfortunately without succes...

if [Account Group] = "999999" and [Costcenter] in ('200', '240', '270') then B1. = failed

if [Account Group] = "999999" &&  [Costcenter] in ('200', '240', '270') then B1. = failed

any ideas?

thanks!

M

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @Anonymous

 

Try this

 

if [Account Group] = 999999 and List.Contains({200, 240, 270},[Costcenter] ) then [B1] else null

 

If the Columns Account Group and Costcenter are of Text Type then use ""

 

if [Account Group] = "999999" and List.Contains({"200","240", "270"},[Costcenter] ) then [B1] else null

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

HI @Anonymous

 

Try this

 

if [Account Group] = 999999 and List.Contains({200, 240, 270},[Costcenter] ) then [B1] else null

 

If the Columns Account Group and Costcenter are of Text Type then use ""

 

if [Account Group] = "999999" and List.Contains({"200","240", "270"},[Costcenter] ) then [B1] else null

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors