Skip to content

Instantly share code, notes, and snippets.

@ncalm
Created August 31, 2022 22:59
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 ncalm/0203a0ad3c9e8a3dea9a2d804224e629 to your computer and use it in GitHub Desktop.
Save ncalm/0203a0ad3c9e8a3dea9a2d804224e629 to your computer and use it in GitHub Desktop.
Power Query patterns for changing default behavior when combining text values
//"a" & null = "a"
//null & "b" = "b"
//And this behavior which is different to the default behavior for Text.Combine:
//null & null = null
//Default separator is an empty string
custom_combine = (columns as list,optional sep as nullable text) =>
if
ListAllNull(columns)
then
null
else
Text.Combine(
columns,
if sep = null then "" else sep
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment