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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

IF

Hi All,

 

I would like to create a calculated column using IF. I am not sure how to use multiple Logical test.

For eg:

I have a set of locations. And each location belong to a certain region. It looks something like the image below.

Megha3012_0-1630321482238.png

I want to create a calculated column called "Region" in PowerBI, where it checks what location and allot the particular region.

 

Can I please know how can I implement that?

 

Any help would be appreciated!

 

Thank you!

Megha

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

You can try below code:-

Region =
IF (
    LOCATION[Location] IN { "PL60", "MA81", "MA82" },
    "EMEA",
    IF ( LOCATION[Location] IN { "2201" }, "APAC", "NA" )
)

image.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

You can try below code:-

Region =
IF (
    LOCATION[Location] IN { "PL60", "MA81", "MA82" },
    "EMEA",
    IF ( LOCATION[Location] IN { "2201" }, "APAC", "NA" )
)

image.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thank you so much! @Samarth_18 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.