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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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