Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to recalculate a column value, for instance
I have a column that is showing pices like a Units values, do I need is to recalculate the column and show the Units in Dozens and left the new value in the sam column.
The figure below shows the column Pieces produced, the second column DZ is the recalculated value in DZ, later I need to replace the DZ values in Pieces Produced, can I recaulculate it in running time, hitting button or slice selection?
Solved! Go to Solution.
Hi @Rigoleto,
Do you want to replace the values of [Pieces produced] with values of [DZ]? If so, you can use the Replacer.ReplaceValue function in Power Query.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIyMLTQNTAEIiDH0ABImCrF6iDLGUHkjEByhhZoksYQSWOQpJERWNIJw1RTEIEuCTUWaKKOkjmaHMxUsEZjpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Product = _t, Date = _t, Ind1 = _t, Ind2 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Date", type date}, {"Ind1", Int64.Type}, {"Ind2", Int64.Type}}), #"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Pieces produced],each _[DZ],Replacer.ReplaceValue,{"Pieces produced"}) in #"Replaced Value"
Be sure to use the " each _[Values Column]" syntax with the spaces before and after "each", otherwise you will get an error.
Best regards,
Yuliana Gu
Hi @Rigoleto,
Do you want to replace the values of [Pieces produced] with values of [DZ]? If so, you can use the Replacer.ReplaceValue function in Power Query.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIyMLTQNTAEIiDH0ABImCrF6iDLGUHkjEByhhZoksYQSWOQpJERWNIJw1RTEIEuCTUWaKKOkjmaHMxUsEZjpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Product = _t, Date = _t, Ind1 = _t, Ind2 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Date", type date}, {"Ind1", Int64.Type}, {"Ind2", Int64.Type}}), #"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Pieces produced],each _[DZ],Replacer.ReplaceValue,{"Pieces produced"}) in #"Replaced Value"
Be sure to use the " each _[Values Column]" syntax with the spaces before and after "each", otherwise you will get an error.
Best regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |