Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello, i'm trying to count the number of white spaces in the beggining of a string in Power Query...
I couldn't find a solution yet.
Here's an example
I have to count just the whitespaces before the text.
Please, help me 🙂
Tks
Solved! Go to Solution.
Hi, @catheprado
Try this:
= Table.AddColumn(<YourPreviousStepName>, "space_cnt", each Text.Length([<YourColumnName>])-Text.Length(Text.TrimStart([<YourColumnName>])))
Hi, @catheprado
Try this:
= Table.AddColumn(<YourPreviousStepName>, "space_cnt", each Text.Length([<YourColumnName>])-Text.Length(Text.TrimStart([<YourColumnName>])))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.