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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.