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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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