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! Get ahead of the game and start preparing now! Learn more
Hi, how would i split a column like this:
Category1
SR-01
SR-02
SR-03
Category 2
SR-05
INC-01
INC-02
Category 3
INC-03
SR-06
etc etc
Solved! Go to Solution.
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.
This is what i have minus the top 2 lines which contain info i cant post eg source of files:
#"Removed Top Rows" = Table.Skip(#"Changed Type",5),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"RequestID", type text}, {"Request Mode", type text}, {"Technician", type text}, {"Created Time", type datetime}, {"Completed Time", type datetime}, {"Subject", type text}, {"Request Type", type text}})
#"Added Custom" = Table.AddColumn(Source, "Inc/SR", each if Text.StartsWith([RequestID],"SR-",Comparer.OrdinalIgnoreCase) or Text.StartsWith([RequestID],"INC-",Comparer.OrdinalIgnoreCase) then [RequestID] else null),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Category", each if [#"Inc/SR"]=null then [RequestID] else null),
#"Filled Down" = Table.FillDown(#"Added Custom1",{"Category"}),
#"Filtered Rows" = Table.SelectRows(#"Filled Down", each [#"Inc/SR"] <> null and [#"Inc/SR"] <> ""),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"RequestID"})
in
#"Changed Type1"
I then get an error:
Expression.SyntaxError: Token ',' expected.
Hi,
You'd need 3 major Power Query UI steps. For your sample data, first add a column,
Fill down 'Custom' Column.
Filter out 'Category' in Column1
The rest would be renaming, reordering etc.
Same logic for your new data @dommyw277
In Power Query Editor, add an Index column, then use a custom function to split grouped values into separate Category/Item rows.
Add Index: Select column > Add Column > Index Column (from 0).
Custom Column with M formula:
Expand List: Expand the new list column to rows (Attribute=Category, Value=Item).
Replace your query step with:
Filter nulls, remove Index.
thank you. I want to put all the categories in one column and the SR plus INC in another column
Can you explain what outcome you want to get?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 35 | |
| 33 | |
| 32 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 96 | |
| 77 | |
| 67 | |
| 65 |