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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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