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
Hello,
I've created a few measures to calculate a metric showing the prior year and a trailing last year (from the last completed month). However, when I go to visualize these, using a visual level filter doesn't limit the data correctly on one of the measures.
Here are the 2 measures:
Cost Per Pound Prior Year = CALCULATE([Cost Per Pound],USERELATIONSHIP('tms_dw aym_invoiced_all'[master date],DateKey[Date]),DATEADD(DateKey[Date],-12,month))
Cost Per Pound Last Year Rolling = CALCULATE([Cost Per Pound],USERELATIONSHIP('tms_dw aym_invoiced_all'[master date],DateKey[Date]),DATESINPERIOD(DateKey[Date],EOMONTH(lastdate(DateKey[Date]),-1),-12,month))
Here is the result:
If I only include the Cost Per Pound Prior Year metric, then I can apply the visual level filter to only show the last 12 calendar months (using the DateKey[Date] field). However, if I include both, then the visual level filter doesn't properly filter.
Any help would be greatly appreciated.
Seth
@Anonymous,
Instead of time intelligence function, you could try to implement a custom DAX formula.
https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/
Thanks Sam, but shouldn't the time intelligence functions work properly? The values are correct, but why won't it allow the visual level filter to apply properly?
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!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 59 | |
| 51 | |
| 46 |