Forum Discussion

jyaul786's avatar
jyaul786
Helper II
2 years ago
Solved

Remove Right most Item from Path column

Friend,,

 

i have path column:

ABC
ABC|CDE|XYZ
ABC|CDE|PQR|EFE
DE|MNO
DE|MNO|LP

 

i want to get remove right most Item from path column and result will be like:

ABC
ABC|CDE
ABC|CDE|PQR
DE
DE|MNO

 

how can i achieve using DAX ?

2 Replies

  • pls try this

    PositionOf = 
    IF( PATHLENGTH('Table'[Path])=1,'Table'[Path],
    LEFT('Table'[Path],
    ABS(LEN('Table'[Path])-LEN(PATHITEMREVERSE('Table'[Path],1))-1)))