Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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"
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
60 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |