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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Wresen
Post Patron
Post Patron

Text Search column in block of 4 from left

Hi and thanks for reading this.

I have a litte problem i cant solve.

 

I have a table with a column that contains a long string (each row contains this a string like the one below)

String Column
ABC1DD1BAS2BBAS2

 

I would like to be able to search this column (String Column) on the base of 4 Character starting from left.

So if i search DD1B i would get a flag that it excsist.

 

Here is what i mean by 4 character , if i search form DD1B (Block 2) i get a flag that it excist ,but if i search for 1BAS (Half Block 2 and Half Block 3) i dont get the flag.

 

It needs to be a Measure.

block.PNG

 

 

Thanks so much for any help

2 REPLIES 2
rsbin
Super User
Super User

@Wresen ,

Use the following Calculated Columns in DAX:

Block1 = LEFT( [String Column], 4 )

Block2 = MID( [String Column], 5, 4 )

Block3 = MID( [String Column], 9,4 )

Block4 = RIGHT( [String Column],4 )

rsbin_0-1708534328470.png

The same approach can be done in Power Query.  The Text Functions are a little different, but same approach

Hope this helps.

Hi @rsbin 

Thanks for your suggestion but that will not work since the string is VERY long, i need to be able to search in the string in a 4 block way (and not try to break up the string in 4 blocks),
I also need it to be in a measure 

 

/Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.