Forum Discussion
Anonymous
3 years agoNot applicable
Conditional Fill Down (Base on a Column)
Hello everyone, I'm in need to conditionally fill down a column base on another column within the table. I currently have a table with the format somewhat like below: After doing some c...
- 3 years ago
Hi Anonymous ,
Try this:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZdDBCoAgDAbgd9nZQ1KQHZNidAvdJcT3f42cNpolMuHzd4opgQUDq4+llhkgmwRVsNRx4MFbwvEJVphYEJvEPmM/ByVWYWY5iGOLvsFVv9hdY5IGeyDFooFItbW85XGTvmU9JamsZe3vVRqoF/d+RL4B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Cust#" = _t, #"Cust Name" = _t, Limit = _t, Terms = _t]), #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Cust#", "Cust Name", "Limit", "Terms"}), #"Filled Down" = Table.FillDown(#"Replaced Value",{"Cust#"}), #"Grouped Rows" = Table.Group(#"Filled Down", {"Cust#"}, {{"Rows", each _, type table [#"Cust#"=nullable text, Cust Name=nullable text, Limit=nullable text, Terms=nullable text]}}), #"Fill Down" = Table.TransformColumns( #"Grouped Rows", { {"Rows", each Table.FillDown(_, {"Limit"})} } ), #"Fill Up" = Table.TransformColumns( #"Fill Down", { {"Rows", each Table.FillUp(_, {"Limit"})} } ), Expanded = Table.Combine(#"Fill Up"[Rows]) in Expanded
latimeria
Solution Specialist
3 years agoHi Anonymous ,
Try this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZdDBCoAgDAbgd9nZQ1KQHZNidAvdJcT3f42cNpolMuHzd4opgQUDq4+llhkgmwRVsNRx4MFbwvEJVphYEJvEPmM/ByVWYWY5iGOLvsFVv9hdY5IGeyDFooFItbW85XGTvmU9JamsZe3vVRqoF/d+RL4B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Cust#" = _t, #"Cust Name" = _t, Limit = _t, Terms = _t]),
#"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Cust#", "Cust Name", "Limit", "Terms"}),
#"Filled Down" = Table.FillDown(#"Replaced Value",{"Cust#"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Cust#"}, {{"Rows", each _, type table [#"Cust#"=nullable text, Cust Name=nullable text, Limit=nullable text, Terms=nullable text]}}),
#"Fill Down" = Table.TransformColumns(
#"Grouped Rows",
{
{"Rows", each Table.FillDown(_, {"Limit"})}
}
),
#"Fill Up" = Table.TransformColumns(
#"Fill Down",
{
{"Rows", each Table.FillUp(_, {"Limit"})}
}
),
Expanded = Table.Combine(#"Fill Up"[Rows])
in
Expanded
Anonymous
3 years agoNot applicable