Forum Discussion
airportplanner
8 years agoFrequent 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...
- 8 years ago
i only changed the position of the parentheses
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))
BKirsch12
8 years agoResolver II
Yes Nippon is right, the issue is your LEN function needs to return a value before it can be compared to 11.
airportplanner
8 years agoFrequent Visitor
Thank you both.
My final working code is:
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)))