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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I have monthly sales data and a date table. I have calculated trailing 12 month (TTM) average sales.
I want to display TTM for most recent month on a card on a report.
If I add a flag to the data table for the most recent month, and then add that as a filter to the card, the TTM recalculates to use only 1 month worth of data.
Any ideas?
Solved! Go to Solution.
@GilbertQ thanks for the suggestion.
I found the following worked:
Sales_ttm avg. =
AVERAGEX( KEEPFILTERS(VALUES('Date'[Date].[Date])), CALCULATE(SUM('Sales'[Value]),'Date'[FLAG_TTM]=1)
)
Hi @mbegg,
I think you can try write a measure and use today function to get last date to filter on TTM measure.
If above not help, can you please share some sample data and the formula?
Regards,
Xiaoxin Sheng
Hi @mbegg
What I would suggest doing is to create your measure where the most recent month is factored into your measure. So that when you put it into your card visual you will not have to still create a filter.
What happens is when you put in a filter, it changes your measures filter context to apply the filter that you added, which is why it then recalculates to only use 1 months worth of data.
@GilbertQ thanks for the suggestion.
I found the following worked:
Sales_ttm avg. =
AVERAGEX( KEEPFILTERS(VALUES('Date'[Date].[Date])), CALCULATE(SUM('Sales'[Value]),'Date'[FLAG_TTM]=1)
)