Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a column which contains last name, fist name, and email. I want to get first name and last name from that usnig DAX.
I have tried using FIND with LEFT, but wasn't successful.
Looking forward to your help.
Example data
No | Person |
1 | Smith, John, john.smith@email.com |
2 | Morris, Elena, elena.morris@email.com |
3 | Anderson, Jack, jack.anderson@email.com |
4 | Harris, Mari, mari.harris@email.com |
Output
No | Person | Name |
1 | Smith, John, john.smith@email.com | John Smith |
2 | Morris, Elena, elena.morris@email.com | Elena Morris |
3 | Anderson, Jack, jack.anderson@email.com | Jack Anderson |
4 | Harris, Mari, mari.harris@email.com | Mari Harris |
Thanks
Solved! Go to Solution.
Hi @Anonymous
M is more intuitive...
Column =
VAR firstP = SEARCH(",",[Person],1)
VAR secondP = FIND(",",[Person],firstP+1)
RETURN
MID([Person],firstP+1,secondP-firstP-1)&" "&LEFT([Person],firstP-1)
Hi @Anonymous
M is more intuitive...
Column =
VAR firstP = SEARCH(",",[Person],1)
VAR secondP = FIND(",",[Person],firstP+1)
RETURN
MID([Person],firstP+1,secondP-firstP-1)&" "&LEFT([Person],firstP-1)
This would be much easier in the query editor. Why not do it there?
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |