Forum Discussion

rabeeh's avatar
rabeeh
Regular Visitor
2 years ago

DAX CODE FOr SLIT

I WANT TO GET RESULT 1 FROM 3:01,ANYONE CAN SUGGEST THE CODE?

3 Replies

  • Hi rabeeh 

     

    If you have just string value, you can use the below code:

    Result =
    VAR SpStr = SUBSTITUTE("3:01", ":","|")

    RETURN
    RIGHT(SpStr, 1)

    If you are working with a column, the adjusted code would be
    Result =
    VAR SpStr = SUBSTITUTE(Table[ColumnName], ":","|")

    RETURN
    RIGHT(SpStr, 1)


    Hope this helps!!
    If this solved your problem, please accept it as a solution!!

    Best Regards,
    Shahariar Hafiz
  • rabeeh's avatar
    rabeeh
    Regular Visitor

    Dear mr Shahariar Hafiz for your reply,but still the result is showing error in colomns.

    • shafiz_p's avatar
      shafiz_p
      Super User

      could you please share image of your error. Also if possible show image of your column partly. I have considered your column data format is 3:01 and you are interested to only last part of 01 , which is 1. Now what if there is 12, in this case are you interested to only 2 or both 12.