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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors