Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I've searched high and low and can't find an answer to this question. I need to add a card to my dashboard that shows the YOY calculation. I used the quick measure option and it works like a charm. My issue though, is that I want the card to default to the value for the latest date in the data set (before any date is selected in the slicer).
In my example, I have dates going from 1/1/2020 through 1/1/2022. The card should show the YOY Diff value, based on the date selected in the slicer. As the dates are selected in the date slicer, the values are correct in the card. But as a default, I want the card to show the 1/1/2022 value of 122%. (the latest date in the dataset). Next month, the default value will be the 2/1/2022 value. I don't want to set a filter on the card because it needs to be dynamic. Can anyone help me please?
Attached is a screenshot of the data set, card and slicer. Much appreciated!!
Tinar1029
Solved! Go to Solution.
@Anonymous You can use the LASTDATE function to find the most recent transaction in your fact table.
So add an IF condition to your measure:
=
VAR _LastTransaction = LASTDATE ( TblSampleData[Date] )
VAR _SelectedDate = MAX( DateDim[Date] )
RETURN
IF ( _SelectedDate < _LastTransaction, [YoY Measure], CALCULATE ( [YoY Measure] , DateDim[Date] = _LastTransaction ) )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous You can use the LASTDATE function to find the most recent transaction in your fact table.
So add an IF condition to your measure:
=
VAR _LastTransaction = LASTDATE ( TblSampleData[Date] )
VAR _SelectedDate = MAX( DateDim[Date] )
RETURN
IF ( _SelectedDate < _LastTransaction, [YoY Measure], CALCULATE ( [YoY Measure] , DateDim[Date] = _LastTransaction ) )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!