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
am_i_really
Frequent Visitor

Looking for measure or custom column similar to if else statement

Hi All, 

 

I'm looking for a measure or custom column that is similar to an if else statement. My column [Type] has a bunch of values that start with AE, what I need is that for any entry that starts with AE the result should be "AE", everything else should be "other". 

 

Table name: Table

Column name: Type

Text starts with AE: AE

All other entries: Other

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can write a custom column in the query editor like this:

if Text.Start([Type], 2) = "AE" then "AE" else "Other"

The DAX calculated column equivalent would be

IF ( LEFT ( [Type], 2 ) = "AE", "AE", "Other" )

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

You can write a custom column in the query editor like this:

if Text.Start([Type], 2) = "AE" then "AE" else "Other"

The DAX calculated column equivalent would be

IF ( LEFT ( [Type], 2 ) = "AE", "AE", "Other" )

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors