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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
emveha
Resolver III
Resolver III

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 @emveha

 

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


Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

HI @emveha

 

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


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.