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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mark_carlisle
Advocate IV
Advocate IV

SQL to split a column by delimiter

I'm building a report using direct query rather than import as I would like users to see real time data. This is the first time using this and a few of the functions I would usually use in the query editior to model the data don't work for direct query. The main issue being that I am unable to split a column by a delimiter. I've done some brief research and it would appear that I'm going to use SQL to split the column before it gets to Power BI. The question is how do I do this?

 

My query so far is;

 

 

SELECT [IncidentId]
      ,[IncidentReference]
      ,[AccountNumber]
      ,[CreateDate]
      ,[CreateStaffDetailId]
      ,[ModifyDate]
      ,[CurrentStaffDetailId]
      ,[CurrentIncidentStatusId]
      ,[CurrentProductDescription]
      ,[CurrentClassificationText]
  FROM [***].[dbo].[***]

 

The column I need to split is CurrentClassificationText, Currently it is stored in the database and then pulled into Power BI like this;

 

CurrentClassificationText
[ClassificationTier1] > [ClassificationTier2] > [ClassificationTier3] > [ClassificationTier4]


I need to have the data in Power BI like this;

 

CurrentClassificationText1CurrentClassificationText2CurrentClassificationText3CurrentClassificationText4
[ClassificationTier1][ClassificationTier2][ClassificationTier3][ClassificationTier4]
1 ACCEPTED SOLUTION

Thank you, I tried this earlier and was getting no where with it. I've checked Allow unrestricted measures in DirectQuery mode and this is now working.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@mark_carlisle,

You can try this solution out using DAX to see if it works

Thank you, I tried this earlier and was getting no where with it. I've checked Allow unrestricted measures in DirectQuery mode and this is now working.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.