Left & Right Formula in Power Query

cyliyu

New Member
Joined
Jul 7, 2015
Messages
23
In my Excel spreadsheet, I have a formula that I use to mask out some of the digits.

=Left(A1,5)&"**** **** "&Right(A1,4)

I'd like to use it in Power Queries; how can I use this formula to create a custom column?
It gives me LEFT that not recognize.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    //Left(A1,5)&"**** **** "&Right(A1,4)
    tbl = Table.AddColumn(Source, "Column2", each Text.Start([Column1], 5) & "**** **** " & Text.End([Column1], 4)) 
in
    tbl

Book1
ABCDE
1Column1Column1Column2
2abcdefghijklmnopqrsabcdefghijklmnopqrsabcde**** **** pqrs
3
Sheet1
 
Upvote 1
How about if I have the number 130767 and want power query to remove three digits, such as 1***67?

What should the syntax be?
I have an error if I use Text.Start
 
Upvote 0
You need to use something like Text.From(numberfield) to convert the number to text first
 
Upvote 0
I experimented with

= Text.Start([coulmn1],1) & "***" & Text.End[(column1],2)

However, receive errors
"We are unable to convert the value 113160 to Text."

I also change the column to Text also same errors.
 
Upvote 0
Power Query:
= Text.Start(Text.From([column1]),1) & "***" & Text.End(Text.From([column1]),2)
 
Upvote 1
Solution

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top