In reference to Power Query in Power BI. M formulas.
We have columns DATA 2 and DATA 3, we would like to replace the values in DATA 2 with the last index item of the column value, delimiter is ..
Next, for DATA 3 column, we would like to replace the values in DATA 3 with everything after the second delimiter of ..
The original DATA 2 and DATA 3 columns looks like this:
So for DATA 2, we got this code:
#"Split Column by Delimiter" = Table.SplitColumn(#"Replaced Value", "DATA 2", Splitter.SplitTextByEachDelimiter({"."}, QuoteStyle.Csv, false), {"DATA 2.1", "DATA 2.2"}),
#"Removed Columns1" = Table.RemoveColumns(#"Split Column by Delimiter",{"DATA 2.1"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns1",{{"DATA 2.2", "DATA 2"}}),
First part of question, is there a cleaner method so not to create two columns and deleting columns? We do want to replace the values of the column DATA 2 with the M formula results, and also for DATA 3.
Second part of question, for DATA 3 column, the number of return fields of the delimiting is not consistent. Some DATA 3 fields have 3 or 4 up to even 6 returned delimited fields.
For example DATA 3, the value could be 10.02.03.03 or it could be 10.01.05.03.07. The desired replacement value for these examples would be 03.03 and 05.03.07. Basically, removing the first two delimited values.
We have been trying this M function:
Text.AfterDelimiter("10.03.06.02", "-", 1)
