Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
We have a requirement to split First and Last name from Fullname in direct query mode using DAX.
Hi @Mahipal ,
I made simple samples and you can check the results below:
First Name = PATHITEM(SUBSTITUTE(MAX('Table'[User Name]),",","|"),1)
Last Name = PATHITEM(SUBSTITUTE(MAX('Table'[User Name]),",","|"),2)
An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Its working fine for import mode. Here we are using direct mode so the output is different as in the below image in direct mode
Can you find the query for direct mode.
Hi @Mahipal ,
It's strange, I used the solution @Dangar332 provided and I was able to get the right data.Did you create a calculated column instead of a measure?
Best regards,
Community Support Team_ Scott Chang
Thank you so much. Yes as measure this query is working. But I would like to have a query for Calculated Calumn as per our requirement.
Hi @Mahipal ,
As far as I know, there doesn't seem to be a way for this to be realized by calculating columns.
Best regards,
Community Support Team_ Scott Chang
Hello @Dangar332 your Query is working but results are not perfect. I am seeing same Name for all records.
hi, @Mahipal
you have any Unique identity on which we can add first name and last name in all rows.
and why cash,johnny only is there any specific condition?
I am using same query which you sent here. But the result is only one name. Here is query
hi, @Mahipal
try below code for measure
Firstname =
LEFT(
MIN('Table (2)'[Name]),
SEARCH(",",MIN('Table (2)'[Name]))-1
)
Last name =
RIGHT(
MIN('Table (2)'[Name]),
LEN(MIN('Table (2)'[Name]))-SEARCH(",",MIN('Table (2)'[Name]))
)
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If i modified that query from
I am still not getting proper results.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |