Forum Discussion

ThoSch's avatar
ThoSch
Regular Visitor
9 years ago
Solved

cut Text with LEFT and FIND

Hi,

 

i need to cut die the domain from an e-mail columns, i tryed the command:

 

Domain1 = LEFT(Tabelle1[Column1];FIND("@";Tabelle1[Column1]-1))

 

 

 

 

And iam wondering that i have two diffrent Error Codes.

 

How can i fixed this?

 

Thanks

  • Hi,

     

    You can do this so much easier via the Query Editor and use the split column transformation and split by @

     

     

     

     

    BR

    Erik

  • ThoSch then you can use the last parameter of FIND function - NotFoundValue and set it to 1. If you want blank, when there is no @ in email. If you want the text, then insert IF function as well.

     

    Regars.

    Pavel

5 Replies

  • donsvensen's avatar
    donsvensen
    Icon for Skilled Sharer rankSkilled Sharer

    Hi,

     

    You can do this so much easier via the Query Editor and use the split column transformation and split by @

     

     

     

     

    BR

    Erik

    • ThoSch's avatar
      ThoSch
      Regular Visitor

      Thanks, the solution is working fine for me.

  • PavelR's avatar
    PavelR
    Icon for Solution Specialist rankSolution Specialist

    Hi ThoSch. Subtracting by 1 should be after FIND function. DAX should be as:

     

    Domain1 = LEFT(Tabelle1[Column1];FIND("@";Tabelle1[Column1])-1)

    Regards.

    Pavel 

    • ThoSch's avatar
      ThoSch
      Regular Visitor

      thanks, that solved one problem, but if there is empty field, i have the other error.

       

      • PavelR's avatar
        PavelR
        Icon for Solution Specialist rankSolution Specialist

        ThoSch then you can use the last parameter of FIND function - NotFoundValue and set it to 1. If you want blank, when there is no @ in email. If you want the text, then insert IF function as well.

         

        Regars.

        Pavel