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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.