-
-
Save ImkeF/187e5c3840738c70276810c4ad2fef4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(MyTable as table, MyColumnName as text) => | |
// Pads a number column with leading zeroes so that an alphabetical sort returns the same than a numerical sort. | |
// www.TheBIccountant.com | |
let | |
Source = Table.TransformColumns( | |
MyTable, | |
{ | |
{ | |
MyColumnName, | |
each Text.PadStart( | |
Text.From(_), | |
Text.Length( | |
Text.From( | |
List.Max( | |
Table.Column( | |
Table.TransformColumns( | |
MyTable, | |
{{MyColumnName, Number.From}} | |
), | |
MyColumnName | |
) | |
) | |
) | |
), | |
"0" | |
), | |
type text | |
} | |
} | |
) | |
in | |
Source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment