TRIM removes whitespace. You want a SUBSTRING of the text.
Try this
declare @text varchar(50) = 'AM.JUBAIL.PRE-FINISHING-LINE.PFBSTR.PFBST1'
select reverse(left(reverse(@text), charindex('.',reverse(@text)) - 1))
Here is the reference material
LEFT (Transact-SQL) | Microsoft Docs[
^]
REVERSE (Transact-SQL) | Microsoft Docs[
^]
CHARINDEX (Transact-SQL) | Microsoft Docs[
^]
If you look at the results of these queries you can see more easily what is going on ...
select reverse(@text)
select charindex('.',reverse(@text))
select left(reverse(@text), charindex('.',reverse(@text)) - 1)
Results ...
1TSBFP.RTSBFP.ENIL-GNIHSINIF-ERP.LIABUJ.MA
7
1TSBFP
[EDIT] Apologies - this was quite clearly tagged SSRS and I provided a SQL solution. Try the following instead (caveat - untested)
= Mid(Fields!LastEquipment.Value, InstrRev(Fields!LastEquipment.Value, ".") + 1, Length(Fields!LastEquipment.Value))