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.
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])
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 |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |