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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Mainer04401
Helper III
Helper III

IF [state] ="FL" or "GA", or "AL" or "LA" ...

I'm trying to write what I thought would be a simple expression but I'm stumped ...

I want to write an expression that returns one measure for stores in states specified and another measure for stores in states not specified.  For example, IF([State]="FL" or "GA" or "AL" or "LA", [Measure 1], [Measure2])

 

When I write the IF statement in a new measure, it appears that I can only evaluate measures and not dimensions like [State].  The other issue is how do I evaluate if the state column contains any of the states specified rather than just one state.  

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Mainer04401 , Try like

IF([State] in{"FL", "GA", "AL" ,"LA"}, [Measure 1], [Measure2])

if you need more help make me @

Appreciate your Kudos.

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Mainer04401 , Try like

IF([State] in{"FL", "GA", "AL" ,"LA"}, [Measure 1], [Measure2])

if you need more help make me @

Appreciate your Kudos.

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

@amitchandakThank you but after I write If( the only fields I can enter are measures.  None of my columns (dimensions such as state) are showing up.  Do I need to write this expression in a column instead of a measure?

@Mainer04401 ,

one of two

IF(firstnonblank([State],blank()) in{"FL", "GA", "AL" ,"LA"}, [Measure 1], [Measure2])
IF(max([State]) in{"FL", "GA", "AL" ,"LA"}, [Measure 1], [Measure2])

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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