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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Data-junkie
Regular Visitor

Differnece between two dates with maxx and filter

Hi Everyone, Hope your all keeping well and sane.

 

I have been trying to find out how i can work this out.

 

i have a column that works out the MAXX date a toner was used from a site stock per site. That works fine

 

This is my calculation

 

Last Fitted Date Site =
VAR ProductCode = 'All Stock'[ProductCode]
RETURN

VAR LocCode = 'All Stock'[LocationCode]
RETURN
Maxx(
Filter(all('New Parts fitted' ), 'New Parts fitted'[Product Code] = ProductCode && 'New Parts fitted'[Site Code] =LocCode), 'New Parts fitted'[ActualOnSiteDate])
 
I now want to know how many days each toner has been held in stock per each site. I have a column that gives me the last date a toner was stored called 'New Parts fitted'[Last Rep Date]
 
So i want to filter the product code and site code and divide the 'New Parts fitted'[Last Rep Date] by TODAY() to me the differnece in days, but can i get it to work, oh no. 
 
Any help much appreciated. 
 
Dean
1 REPLY 1
dedelman_clng
Community Champion
Community Champion

Hi @Data-junkie  - can you share your pbix or give more info about your model and provide sample data?  You should probably be able to do something similar to what you have already done, but a lot depends on what your model and data look like.

 

David

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.