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.
Good day to all. I will try to summarize the essence briefly: I have a column with an average cost of one megabyte in the context of regions and settlements. But among them there are empty values (if there is no settlement). I Apend this querie with another one where the average values were calculated just for empty values. Thus, at the output, I have two columns with an average cost -
"APPMb" and "N.APPMb". Now I need an action that will create a new column and will replace empty values of the APPMb column with non_empty values of N.APPMb values. Is it possible?
Solved! Go to Solution.
Hi @Anonymous ,
You could try the following code.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQKhWJ1oJSMI28gQzDOG8AwNwDwTKM8UzDOF8IwhPDOQJgMIERsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, #"APP Mb" = _t, #"N.APP Mb" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"APP Mb", Int64.Type}, {"N.APP Mb", Int64.Type}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [APP Mb] = null then [N.APP Mb] else [APP Mb]) in #"Added Custom"
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You could try the following code.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQKhWJ1oJSMI28gQzDOG8AwNwDwTKM8UzDOF8IwhPDOQJgMIERsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, #"APP Mb" = _t, #"N.APP Mb" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"APP Mb", Int64.Type}, {"N.APP Mb", Int64.Type}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [APP Mb] = null then [N.APP Mb] else [APP Mb]) in #"Added Custom"
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
105 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |