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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
airportplanner
Frequent Visitor

IF statement with LEN, LEFT & RIGHT formulas

Hello, new to Power Bi, sorry if this is a basic question.

 

I have a column with 2 types of data (lets call it Flight No Colunn) : BA254/BA879 and BA463/548

 

I have created a helper column that returns the length of each cell (11 or 9)

 

I would like to create an if command like this:

 

IF(LEN[Flight No Column]=11, RIGHT[Flight No Column, 5], CONCATENATE(LEFT([Flight No Column], 2), RIGHT([Flight No Column], 5))

 

However, this does not work as I am combining numbers with text in the same formula.

 

Do you have any suggestions?

 

Thank you very much

 

 

 

1 ACCEPTED SOLUTION

i only changed the position of the parentheses

 2018-06-20_8-53-43.png

Column 2 = IF(LEN(Table1[Flight No Column]) =11, RIGHT(Table1[Flight No Column], 5), CONCATENATE(LEFT(Table1[Flight No Column], 2), RIGHT(Table1[Flight No Column], 3))

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.