Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Left(1) in power query

Hi,

 

I have a column with nominal codes ie

 

144722

 

Now if it begins with 1 I want to have a column which says Carlisle.

 

2 would be Egremont.

 

How would I go about doing column based on the first digit in another column in Power Query.

 

Thanks

 

Chris

 

 

  • Anonymous

    In the Query Editor, try adding this Custom Column

     

    =if Text.Start(Text.From([ColumnName]),1)="1" then "Carlise" else "Egremont"

2 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Anonymous

    In the Query Editor, try adding this Custom Column

     

    =if Text.Start(Text.From([ColumnName]),1)="1" then "Carlise" else "Egremont"
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Zubair