Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
If I have a sorted table like below:
Fruit | Colour |
Apple | null |
Apple | Red |
Banana | Yellow |
Pear | null |
How can I replace the null value in "Colour" with the correct value based on matching values in "Fruit"? The table I would want is:
Fruit | Colour |
Apple | Red |
Apple | Red |
Banana | Yellow |
Pear | null |
The query I am trying is:
= Table.ReplaceValue(#"Sorted Rows", null, each [Colour]{List.PositionOf([Fruit],[Fruit], 2)},Replacer.ReplaceValue,{"Colour"})
but this is not working.
Solved! Go to Solution.
= Table.Combine(Table.Group(#"Sorted Rows","Fruit",{"n",each Table.ReplaceValue(_,null,List.Last([Colour]),Replacer.ReplaceValue,{"Colour"})},0)[n])
= Table.Combine(Table.Group(#"Sorted Rows","Fruit",{"n",each Table.ReplaceValue(_,null,List.Last([Colour]),Replacer.ReplaceValue,{"Colour"})},0)[n])