Skip to content

Instantly share code, notes, and snippets.

@lars-erik
Created July 11, 2022 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lars-erik/36578a7a8a932c2e8e36cc2b598c3537 to your computer and use it in GitHub Desktop.
Save lars-erik/36578a7a8a932c2e8e36cc2b598c3537 to your computer and use it in GitHub Desktop.
Power Query Coalesce
let
Coalesce = (items as list) =>
let
listOfFirst = List.FirstN(List.Select(items, each _ <> "" and _ <> null), 1),
first = try List.Single(#"listOfFirst") otherwise null
in
first
in
Coalesce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment