Forum Discussion

PowerBI123456's avatar
PowerBI123456
Icon for Post Partisan rankPost Partisan
5 years ago
Solved

DAX Starts with

Hi - I want to see if a column starts with a specific line of strings (e.g. "992"). How can I do that in DAX (not power query)?

 

Thanks in advance!

6 Replies

    • uzzysan's avatar
      uzzysan
      Regular Visitor

      And what about cases where length of the string I'm looking for vary? For example {"site", "location"}

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        What do you mean by having a different length?

         

        This is for the beginning of the text so it does not matter the size of the text.

  • PowerBI123456 , Try a new column like

    if(left([col1],3) = "992",1,0)

     

    or measure

    calculate(countrows(Table),filter(Table,left([col1],3) = "992",1,0))