Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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.

And I want to achieve something like this

 

  • 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's avatar
    Anonymous
    4 years ago

    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

     

    I hope this helps.
    Thank you

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

     

    I hope this helps.
    Thank you

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity 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 , 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's avatar
      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

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

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

       

       

      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