Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Something like Number.ToText( 2, "00") works fine and returns "02" if only we don't keep query folding with SQL server. In such case above returns "2". Text.PadStart( Number.ToText( 2, "00"), 2, "0") returns "02" but it breaks query folding.
Any way to return number-to-text with leading zeroes and keep query folding?
Solved! Go to Solution.
To preserve query folding, approach is to push the formatting logic to SQL compatible text operations instead using `Text.PadStart`.
#powerquery
RIGHT("00" & Number.ToText([Column]), 2)
#PowerqueryM
Text.End("00" & Number.ToText([Column]), 2)
To preserve query folding, approach is to push the formatting logic to SQL compatible text operations instead using `Text.PadStart`.
#powerquery
RIGHT("00" & Number.ToText([Column]), 2)
#PowerqueryM
Text.End("00" & Number.ToText([Column]), 2)
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |