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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Dynamic Title Card to show previous year of selected value

Hello Community, 

 

I am trying to create Title Cards that are dynamic for my YoY comparison dashboard. I have managed to get it to work for the Selected Year, as seen below, using the following DAX: 

 

Selected Year = SELECTEDVALUE('Date Table'[Fiscal Year], "All Years")
CY Title = COMBINEVALUES(" ", "Emergencies in "&[Selected Year], "for "&[Selected Quarter])

 

Card.PNG

 

For the second card, the one below where it says "Emergencies LY", I would like to create a title card that says "Emergencies in FY015 (dynamic) for All Quarters (dynamic)", I would like it to show the SAMEPERIODLASTYEAR for the Selected Year. However, if nothing is selected, I would like to show the text "All Years". Is this possible? 

 

Thank you for the help, 

 

Denisse

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can use YTD like

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

 

or we can year behind measure

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

 

make sure you use date table

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak , thank you, but I am trying to create a Card to display the title, and they change dynamically based on the slicer. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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