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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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