Forum Discussion

Sudip_J's avatar
Sudip_J
Helper I
1 year ago
Solved

Dax function is not working

Hi Teams ,
I want to get the Last Name of customer Name from superstore data .
And I wrote the the following dax code and it is not working 

last_name = RIGHT(orders[Customer_Name],LEN(orders[Customer_Name])-FIND(" ",orders[Customer_Name]))

Please check and give the correct answer.
Note : It would be great if multiple dax query will be provides by your team
Thanks & Regards,
Sudeep Kumar
all
 
  • Sudip_J ,Try using

     

    dax
    last_name =
    VAR space_position = FIND(" ", orders[Customer_Name], 1, LEN(orders[Customer_Name]))
    RETURN RIGHT(orders[Customer_Name], LEN(orders[Customer_Name]) - space_position)

2 Replies

  • Sudip_J ,Try using

     

    dax
    last_name =
    VAR space_position = FIND(" ", orders[Customer_Name], 1, LEN(orders[Customer_Name]))
    RETURN RIGHT(orders[Customer_Name], LEN(orders[Customer_Name]) - space_position)

  • Hi bhanu,
    thanks for providing the solution .
    I am requesting to can  you please provide another way to get last name ?