Here are two expressions that will get the first Reference Code and second the File Name.
I used a variable in my example, but you can replace that with your dynamic content.
This will get the first part Reference Code:
slice(variables('FileName'),int(0),int(indexOf(variables('FileName'),'$')))
This will get the second part File Name with the extension:
slice(variables('FileName'),add(int(1),int(indexOf(variables('FileName'),'$'))))
Here are photo examples


If you just want the File Name without extension use:
slice(variables('FileName'),add(int(1),indexOf(variables('FileName'),'$')),int(sub(int(lastIndexOf(variables('FileName'),'.')),int(1))))
Here is a photo of that file name without extension:

Let me know if this works for you