List.RemoveNulls Function in Power Query
The List.RemoveNulls function returns a list after removing all “null” values from a list. Please note null is different from the blank and 0 values. Also, the null values are defined without double quotes. This function will not remove the blank or 0 values from the list.
Syntax
List.RemoveNulls(list as list) as list
Example: We have some null values in the list.
Power Query M
let source = {"India", "America", "Canada", "Canada", null, "Australia", "England", "America", null} in source
The output of the above is shown below:
To remove the "null" values from the given list, we can use the List.RemoveNulls function.
Power Query M
let source = {"India", "America", "Canada", "Canada", null, "Australia", "England", "America", null}, return = List.RemoveNulls(source) in return
The output of the above is shown below: