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
VJ1010
Frequent Visitor

Filter based on a existing measure.

I have a measure that is created to calculate the number of years from the time an asset is purchased. 

Warranty in Years = CALCULATE(DATEDIFF(SELECTEDVALUE('Configuration Item'[PAR/PO/EP Date]),TODAY(),MONTH))/12
 
VJ1010_0-1676964323794.png

This is giving me the desired results. 
However, when i try to use the measure in a filter to calculate assets greater than 5 years old it gives an error: 

Dax to calculate out of warranty
 
Out of warranty = CALCULATE([Configuration Item Count],[Warranty in Years]>5)
VJ1010_1-1676964479611.png

 Please can someone help ? 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can't use a measure as a filter in calculate, try

Out of warranty =
COUNTROWS ( FILTER ( 'Configuration Item Count', [Warranty in Years] > 5 ) )

View solution in original post

2 REPLIES 2
VJ1010
Frequent Visitor

Thanks So much, John 🙏

johnt75
Super User
Super User

You can't use a measure as a filter in calculate, try

Out of warranty =
COUNTROWS ( FILTER ( 'Configuration Item Count', [Warranty in Years] > 5 ) )

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.

Top Solution Authors