Join 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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello, I need help in extracting the US Census Data. I have the text as the example in column Race. I wonder how I can devide them into several columns based on their detail. I noticed there are several level, differenting by the number of space, so I'm looking for ways to seperate them, either using Power Query or SQL. Any idea is appreciated. Thanks so much!
Solved! Go to Solution.
Hi @ale259 ,Could you please try this
Add a custom column to count leading spaces:
Text.Length([RACE]) - Text.Length(Text.TrimStart([RACE]))
This will count the number of leading spaces in the RACE column.
Create a New Column for Each Level:
Hi @ale259 ,Could you please try this
Add a custom column to count leading spaces:
Text.Length([RACE]) - Text.Length(Text.TrimStart([RACE]))
This will count the number of leading spaces in the RACE column.
Create a New Column for Each Level:
Hi Akash, I managed to count the leading spaces. Can you guide me on how to split the column based on the number of spaces? There are different level of spaces: 0, 4, 8, 12, 16. Thank you
I have managed to do through all the steps. Thank you so much!
hi @ale259
May be ?
let
Source = Your_Source,
Split = Table.AddColumn(Source, "Split", each Text.Split([RACE]," ")),
Columns = Table.SplitColumn(Split, "Split", each _, 5)
in
Columns
Stéphane
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 14 | |
| 9 | |
| 8 | |
| 7 |