Unlike Qlikview, the chart titles in PowerBI can only be static. as you can only pass a static text in the title parameter.
However, there’s a way around it!
The workaround I found is pretty simple you just need to fake a title by creating a measure which contains your title expression and drop this measure into a Card visual .
Then by applying the same transparency and colours of your chart you just need to turn off the chart tile and put the Card visual on top of your chart.
Here is the code for my title measure:
MyMeasureTitle = ("Total Cost of the Top " & [TopN Value] & " Depts VS all other Depts")
So my title will interact with the above slicer dynamically however if no values are ticked off I still want a default value to be returned so here is the code for this (you might not need to implement it)
TopN Value = IF ( HASONEVALUE ('TopN Filter'[TopN]) , VALUES ('TopN Filter'[TopN]) , 10 )
So after dropping your measure into a Card visual you’ve got your title ready!
And this how it looks when you place it right above your chart:
Make sure your chart and the card have the same size and colour and by setting the right location x,y it will look like the embedded chart title.