Forum Discussion

Loic_Pedro_Hans's avatar
Loic_Pedro_Hans
Regular Visitor
2 years ago
Solved

problem with text functions

Hi,

 

I try to buid a simple formula to extract the first name

 

My formula is : 

 

Prenom =
VAR Pos_Virgule = IFERROR (FIND(",",Customer[Name]), BLANK() )
VAR Taille = LEN( 'Customer'[Name])
IF (
    NOT ISBLANK(Pos_Virgule),    
    VAR Prenom = LEFT( 'Customer'[Name], Taille - Pos_Virgule),
    VAR Prenom = 'Customer'[Name]
)
RETURN Prenom
 
There is an error : La syntaxe de « IF » est incorrecte. 
 
can you help me please.
 
Thanks.

2 Replies

    • Loic_Pedro_Hans's avatar
      Loic_Pedro_Hans
      Regular Visitor

      Thanks Sakiko !!

      I see my error

       

      Prenom =
      VAR Pos_virgule = IFERROR (FIND(",",Customer[Name]), BLANK() )
      VAR Taille = LEN( 'Customer'[Name])
      VAR Mon_Prenom =
          IF (
              NOT ISBLANK(Pos_Virgule),    
              LEFT( 'Customer'[Name], Taille - Pos_virgule),
              'Customer'[Name]
          )
      Return Mon_Prenom