Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi community,
I have a table in which I have a mix of number values, calculated values in one row and one row containing text values as you see a simpliefied version in the following screenshot:
So my outmost goal is to being able to achieve following modifications on the table but in a manner I describe after the screenshot:
I want to freeze the transformed table after first steps upon importing it to Power Query (perhaps using table.buffer function) and then do some transformaiton like filtering the rows with text values and modifying the numbers values on the rows with numerical data. And finally call the steps that were created before and append them to the new table that was transformed and then make the table look like what I shared as a second screenshot.
Please note that I don't want to segregate the tables in to two separated tables for doing transformations and then append them back again. So, the only solution I am looking for is to do all the transformaiton steps in the same table by freezing it after couple of steps then recalling those earlier after some transformation steps.
Your help is much appreciated!
Solved! Go to Solution.
You can use Table.Combine to combine your resulting table with a previous step in the same table.
Here is a small sample code to illustrate...
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8szLLMlMzFFwSSxJVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
stepOne = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
stepTwo = Table.TransformColumns(stepOne,{{"Column1", Text.Upper, type text}}),
stepThree = Table.TransformColumns(stepTwo,{{"Column1", Text.Length, Int64.Type}}),
stepFour = Table.TransformColumns(stepThree, {{"Column1", each _ * 99, Int64.Type}}),
stepFive = Table.Combine({stepTwo, stepFour})
in
stepFive
Proud to be a Super User! | |
You can use Table.Combine to combine your resulting table with a previous step in the same table.
Here is a small sample code to illustrate...
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8szLLMlMzFFwSSxJVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
stepOne = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
stepTwo = Table.TransformColumns(stepOne,{{"Column1", Text.Upper, type text}}),
stepThree = Table.TransformColumns(stepTwo,{{"Column1", Text.Length, Int64.Type}}),
stepFour = Table.TransformColumns(stepThree, {{"Column1", each _ * 99, Int64.Type}}),
stepFive = Table.Combine({stepTwo, stepFour})
in
stepFive
Proud to be a Super User! | |