Forum Discussion
How to expand list column which has empty data
- 4 years ago
I found a simple solution for this . This will save others friend's lot of time. If Microsoft added this step as part of ExpandListColumn, would be great.
Solution:
//Just replace the empty value to empty list as below, that is it.
#"Replaced Value" = Table.ReplaceValue(#"Removed Other Columns","",{""},Replacer.ReplaceValue,{"order_id"}),
//Then expand the column and refresh without that error.
#"Expanded" = Table.ExpandListColumn(#"Replaced Value", "order_id")
Hi Dhacd , Thanks for your reply.
Order_id column has list data. Fill_down did not work for that.
The list is empty for some rows and some has value. When I expand and the refresh, I am getting error as empty object cannot be converted. So in M code, I want to check for empty check, if not empty then that many rows should get created based on th list count.
I found a simple solution for this . This will save others friend's lot of time. If Microsoft added this step as part of ExpandListColumn, would be great.
Solution:
//Just replace the empty value to empty list as below, that is it.
#"Replaced Value" = Table.ReplaceValue(#"Removed Other Columns","",{""},Replacer.ReplaceValue,{"order_id"}),
//Then expand the column and refresh without that error.
#"Expanded" = Table.ExpandListColumn(#"Replaced Value", "order_id")
- fricketyfrack2 years agoRegular Visitor
Genius!