Set a custom title for a measure header.
SETMEASURETITLE(measure, value)
measure - Measure that requires a title change.
value - New title to rename the measure.
SETMEASURETITLE([2024 Actuals], "PY Sales")
//Renames the 2024 Actuals measure to PY Sales

Script to set custom measure headers
Changing the measure header with scripts:

SETMEASURETITLE script