Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Can't separate a field by delimiter while using direct query

Hi Everyone, 

Hoping for a solution to this one. I have a field coming from a sql server using direct query that looks like this: 001|568|222|448|78456|1145

I  need to find a way to seperate each grouping between the "|" delimiter into columns. I have already tried Pathitem, which normally would work if it wasnt direct query and i have checked the box to unrestrict dax measures while using direct query. It didnt seem to fix the fact that i still cant use that particular function. 

I have also used the "split column" button in query editor which lets me seperate the field by delimiter however i cannot save it because "it is not compatible with direct query" 

Any advice for a work around would be much appreciated! Perhaps a mlanguage script would work?? 

Cheers, 
Ben

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The sql function you refer too would create many new rows of data, I am looking to split the Path into columns. Do you have any other recommendations?

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Just so I'm clear on the direction i took. I did not find a solution to perform this task with direct query. I ended up changing connection type to Import in order to gain full dax andpowerquery functionality. 

If you import the data into Power BI, the best place to split the data into multi columns is using the query editor.

 

split columns.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Phil_Seamark
Microsoft Employee
Microsoft Employee

Can you adjust the SQL you use to query the table to pivot the data into rows?  Using CROSS  APPLY or similar?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

Im not sure what you mean by this, The current SQL looks like 

"let
Source = Sql.Databases("efsdb.database.windows.net"),
efsdb = Source{[Name="efsdb"]}[Data],
dbo_WorkItem = efsdb{[Schema="dbo",Item="WorkItem"]}[Data],
#"Duplicated Column" = Table.DuplicateColumn(dbo_WorkItem, "WorkItemPath", "WorkItemPath - Copy")
in
#"Duplicated Column"

 

Ignore the duplicated column query

 

 

Capture.PNG



@Anonymous,

 

You may specify SQL statement in the Advanced options.

https://docs.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql#examples

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The sql function you refer too would create many new rows of data, I am looking to split the Path into columns. Do you have any other recommendations?

Anonymous
Not applicable

The sql function you refer too would create many new rows of data, I am looking to split the Path into columns. Do you have any other recommendations?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.