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.
I have an exisiting table where I need to populate missing rows with no values as per the Current and Required table example below...
Basically, for every entry, there should be every version of the "Timesheet" column, e.g. if only an "Actuals" value exists in the current table, I need the missing row for "Planned" to exist.
Solved! Go to Solution.
Try this.
Pivot the Timesheet Column using Hours as values ("Dont Aggregate")
replace nulls with zero
Unpivot the Actuals and planned columns
Please see attached file for steps
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDU9UrM0zW0VNJRcgTh5JLSxJxiIMtCKVYHUz4gJzEvLzUFyLKEyBsh5J1Q9BsaYBjgTMACZ3QLYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Name = _t, Timesheet = _t, Hours = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Name", type text}, {"Timesheet", type text}, {"Hours", Int64.Type}}), #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Timesheet]), "Timesheet", "Hours"), #"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,0,Replacer.ReplaceValue,{"Planned"}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Date", "Name"}, "Attribute", "Value") in #"Unpivoted Columns"
Try this.
Pivot the Timesheet Column using Hours as values ("Dont Aggregate")
replace nulls with zero
Unpivot the Actuals and planned columns
Please see attached file for steps
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjDU9UrM0zW0VNJRcgTh5JLSxJxiIMtCKVYHUz4gJzEvLzUFyLKEyBsh5J1Q9BsaYBjgTMACZ3QLYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Date = _t, Name = _t, Timesheet = _t, Hours = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Name", type text}, {"Timesheet", type text}, {"Hours", Int64.Type}}), #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Timesheet]), "Timesheet", "Hours"), #"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,0,Replacer.ReplaceValue,{"Planned"}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Date", "Name"}, "Attribute", "Value") in #"Unpivoted Columns"
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 |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |