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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.