Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Loic_Pedro_Hans
Regular Visitor

problem with text functions

Hi,

 

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

Loic_Pedro_Hans_0-1694607482591.png

 

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.
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Loic_Pedro_Hans 

What about like below?  

 

Sakiko_9-1694608896741.png

 

View solution in original post

2 REPLIES 2
DataNinja777
Super User
Super User

Hi @Loic_Pedro_Hans 

What about like below?  

 

Sakiko_9-1694608896741.png

 

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.