Table.SplitColumn Function in Power Query
The Table.SplitColumn function returns a new set of columns from a single column using a splitter function to each value.
Syntax
Table.SplitColumn(table as table, sourceColumn as text, splitter as function, optional columnNamesOrNumber as any, optional default as any, optional extraColumns as any) as table
Example: Split the [Name] column at the delimiter of " " into two columns.
Power Query M
let
Employees = Table.FromRecords({
[EmployeeID = 1, Name = "Ashish Goel", Salary = 40000],
[EmployeeID = 2, Name = "Esha Dixit", Salary = 20000],
[EmployeeID = 3, Name = "Diksha Sharma", Salary = 54000],
[EmployeeID = 4, Name = "Anjelina Jolie", Salary = 15000]
})
in
Table.SplitColumn(Employees, "Name", Splitter.SplitTextByDelimiter(" "), 2) The output will be shown in the following image:
