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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cpereyra
Helper I
Helper I

Delimiter with Direct Query

I need to delimit the following column each time "~" shows. It won't let me do in in Edit Query because I have a Direct Query Connection. Does anyone know a dax to grab the text between "~" shows? Keep in mind that I will need to delimit each time the symbol shows.

Power BI Delimit.PNG

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @cpereyra,

Here I updated my sample PBIX file , please check if the newly added measures can get the expected results you want.In addition, if it is possible to handle with it in data source , then load the split columns into Power BI Desktop?

 

Best Regards

Rena

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @cpereyra ,

You can create one measure as below,  please find full details in my sample PBIX file.The character "~" be displayed multiple times in text column "Extra_Fiels.PCC_ALL", here only get the characters between the first "~" and the last "~".

delimiter.JPG

 FPCC = IFERROR (

   MID (

       MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ),

       FIND ( "~", MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ) ) + 1,

       FIND (

           "@",

           SUBSTITUTE (

               MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ),

               "~",

               "@",

               LEN ( MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ) )

                   - LEN ( SUBSTITUTE ( MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ), "~", "" ) )

           ),

           1

       )

           - FIND ( "~", MAX ( 'PEC Work'[Extra_Fields.PCC_ALL] ) ) - 1

   ),

   ""

)

Best Regards

Rena

amitchandak
Super User
Super User

In Direct Query , You can not create a column, So you need to have a measure. And measure needs calculation. While mid, right , left and search will allow you to do that. You have to move most of your calculations inside x function like sumx, countx, minx etc

 

Like countx(Table,mid(table[Text],1,4))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
VasTg
Memorable Member
Memorable Member

@cpereyra 

 

Try this...

 

 

Column = 
VAR A = IFERROR(FIND("~",'Table (4)'[Column1]),0)
VAR B = IFERROR(FIND("~",'Table (4)'[Column1],A+1),0)-1
RETURN IFERROR(MID('Table (4)'[Column1],A+1,B-A),'Table (4)'[Column1])

 

image.png

 

If it helps, mark it as a solution

Kudos are nice too

 

Connect on LinkedIn

It does work but how would you go about additional delimiters on the same column. 

 

Ex.

 

PEC~Insurances - ~Homeowner 

 

Would need back three columns

1- PEC

2 - Insurances

3 - Homeowner

 

@Anonymous @VasTg @amitchandak 

Anonymous
Not applicable

Hi @cpereyra,

Here I updated my sample PBIX file , please check if the newly added measures can get the expected results you want.In addition, if it is possible to handle with it in data source , then load the split columns into Power BI Desktop?

 

Best Regards

Rena

Your link is removed.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors