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
Anonymous
Not applicable

Create a Text Filter with the first 3 letters with DAX

Good morning, I hope you can help me please.

 

What I want to do is create a filter in such a way that when selecting a box that is TAS , WO , NIC in the column, only the data that begins with those first 3 letters appears.

Captura de pantalla (136).png

And I want to achieve something like this

 

Captura de pantalla (137).png

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , If you need first three without any filter

 

then you can try

left([Numero],3)

 

if you need specific values then

Switch( true() ,

left([Numero],3) in {"TAS" ,"NIC"} , left([Numero],3)  ,

left([Numero],2) in {"WO"} , left([Numero],2) ,

left([Numero],3)  )

View solution in original post

Anonymous
Not applicable

textselect.PNG

You can create a cutom column like this using Text.Select in M Query
Text.Select([Column1], {"A".."Z"})

Which always extracts text from the given value. And it shows like below in the slicer
custom.PNG

 

I hope this helps.
Thank you

View solution in original post

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Whether the advice given by @Anonymous  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

Anonymous
Not applicable

textselect.PNG

You can create a cutom column like this using Text.Select in M Query
Text.Select([Column1], {"A".."Z"})

Which always extracts text from the given value. And it shows like below in the slicer
custom.PNG

 

I hope this helps.
Thank you

amitchandak
Super User
Super User

@Anonymous , If you need first three without any filter

 

then you can try

left([Numero],3)

 

if you need specific values then

Switch( true() ,

left([Numero],3) in {"TAS" ,"NIC"} , left([Numero],3)  ,

left([Numero],2) in {"WO"} , left([Numero],2) ,

left([Numero],3)  )

Anonymous
Not applicable

@amitchandak Thank you very much

Anonymous
Not applicable

@amitchandak 

But I have no measurements, it would only be that when applying the filter I only take TAS, WO, NIC

 

Scarthart_0-1655996311330.png

Captura de pantalla (140).png

 

I am also trying to create a calculated column and that extracts only the cells that start with the first 3 letters, but I do not know what function to use or how to do it, how to find another alternative

Anonymous
Not applicable

@amitchandak Does this formula only work with numbers? since the value I need to filter is a text and when I try to do it it only shows me the measurements

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.