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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spacha
Frequent Visitor

Calculated measure not being allowed to have a "visual level filter" applied

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.

 

Capture 1.PNGCapture 2.PNG

 

Any help would be greatly appreciated.

Seth

 

 

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@spacha,

 

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/

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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?  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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