Forum Discussion
Anonymous
1 year agoNot applicable
Get value before second delimiter in DAX
Hi, How can we get value up to before second delimiter / in DAX creating new column? Hope the solution will not be with Left or Mid fucntion since there will be changes on number of text. Sin...
- 1 year ago
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
expected result CC = VAR _firstfind = FIND ( "/", data[id], 1 ) VAR _secondfind = FIND ( "/", data[id], _firstfind + 1 ) RETURN LEFT ( data[id], _secondfind - 1 )
Jihwan_Kim
Super User
1 year agoHi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
expected result CC =
VAR _firstfind =
FIND ( "/", data[id], 1 )
VAR _secondfind =
FIND ( "/", data[id], _firstfind + 1 )
RETURN
LEFT ( data[id], _secondfind - 1 )
Anonymous
1 year agoNot applicable
Thanks,
Can you further help if there is other values not finding / delimiter? such (blank) and dn$.
I'm not sure what to be more in the future so Im trying to avoid specify these 2 other values in dax code.
- Anonymous1 year agoNot applicable
resolved.
INVUNIT Key dn$ =VAR _firstfind =FIND ( "/", 'CM Data - Equip Info'[INVUNIT $dn], 1 )VAR _secondfind =FIND ( "/", 'CM Data - Equip Info'[INVUNIT $dn], _firstfind + 1 )RETURNIF(CONTAINSSTRING('CM Data - Equip Info'[INVUNIT $dn], "/"), LEFT ( 'CM Data - Equip Info'[INVUNIT $dn], _secondfind - 1 ), BLANK())