Forum Discussion
Nazdac911
3 years agoHelper II
In a List Columns , detect null values and replace them with a value
Hi all I have a couple of columns that contains Lists formed as follow : [ item1, item2, null , item3, .... ] those list values are connected to each others in different columns. When trying to...
Adamboer
3 years agoResponsive Resident
Hi,
To detect null values in a list and replace them with another value, you can use the List.ReplaceNulls function. Here's an example of how you can use it:
Assuming your list is in a column called "ListColumn", you can use the following M code to replace null values with "NoValue":
let
Source = YourDataSource,
#"Replaced null values" = Table.TransformColumns(Source, {"ListColumn", each List.ReplaceNulls(_, {"NoValue"})})
in
#"Replaced null values"
This will replace all null values in the list with "NoValue". You can replace "NoValue" with any other value that you want to use.
vbnet