Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mtrevisiol
Helper V
Helper V

Function as visualization title depending on a slicer

Hello everyone.

I've created a report with a slicer for the year:

slicer.png

and a card that shows the revenues variation of the filtered year compared to the previous one.

scheda.png

Is it possible to create a function that can be used as the title of the card, which shows the year selected on the slicer and the previous one? My goal would be to have "Revenues % variation from 2018 to 2019", when 2019 is selected.

Thank you so much in advance!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@mtrevisiol , Yoy can create a measure and use that in the title . In title you can use a measure using fx

 

measure = "Revenues % variation from "  & Selectedyear(Year[Year]) -1 " to " & Selectedyear(Year[Year]) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Fowmy
Super User
Super User

@mtrevisiol 

Create the following measure and assign it to the Title of the visual under conditional formatting (fx):

Title Year = 
var __yr = SELECTEDVALUE(Dates[Year]) return
"Revenues % variation from " & __yr - 1 & " to " & __yr
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@mtrevisiol 

Create the following measure and assign it to the Title of the visual under conditional formatting (fx):

Title Year = 
var __yr = SELECTEDVALUE(Dates[Year]) return
"Revenues % variation from " & __yr - 1 & " to " & __yr
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@mtrevisiol , Yoy can create a measure and use that in the title . In title you can use a measure using fx

 

measure = "Revenues % variation from "  & Selectedyear(Year[Year]) -1 " to " & Selectedyear(Year[Year]) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.