Forum Discussion
Splitting Column values
- 8 months ago
Hi dommyw277 ,
Thanks for the screenshot that really helps. As per my guess, the Invalid identifier error is coming from the way the column name Inc/SR is being referenced. Because the column name contains a slash (/), Power Query requires the #"" format.
So anywhere you have- [Inc/SR]
please change it to - [#"Inc/SR"]And in your filter step
each [#"Inc/SR"] <> null and [#"Inc/SR"] <> ""Once the column is referenced with [#"...."] , the syntax error should be resolved.
Hope this helps please give it a try. If anything still comes up, feel free to share another screenshot and we can take a look.
Hi dommyw277
Create a “Category” column using Power Query
Step 1: Open Power Query
In Power BI Desktop → Transform Data
---
Step 2: Identify category rows
Add a conditional column or mark rows starting with “Category”:
= Table.AddColumn(PreviousStep, "IsCategory", each if Text.StartsWith([Column1], "Category") then 1 else 0)
---
Step 3: Fill down the category
Select the Column1 (or a new “Category” column)
Transform → Fill → Down
This will copy the last Category value to the rows below until the next category appears.
---
Step 4: Filter out category rows (optional)
If you only want codes with their category, filter IsCategory = 0.
---
Step 5: Rename columns
Column1 → Code
Filled-down column → Category
Your final table:
Category Code
Category1 SR-01
Category1 SR-02
Category1 SR-03
Category2 SR-05
Category2 INC-01
Category2 INC-02
Category3 INC-03
Category3 SR-06
Please Mark [as a solution] if this help you
To help others
Best regards