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
Anonymous
Not applicable

Calculate Days between Max Date and Second Date

I am trying to get the "Lag" days between the MAX "Physical date" and "terms approved date." This is the code I am currently using but it is not working:

 

Lag = DATEDIFF(CALCULATE(MAX(cr93f_cpsoo[Physical Date]), cr93f_cpsoo[Terms Approved DateTime]),DAY())
Error: Too few arguments were passed to the DAY function. The minimum argument count for the function is 1.
 
Please advise. Thank you!
1 ACCEPTED SOLUTION

hi, @Anonymous 

Lag = 
DATEDIFF(
        MAX(cr93f_cpsoo[Physical Date]),
        max(cr93f_cpsoo[Terms Approved DateTime]),
        DAY
  
)

View solution in original post

4 REPLIES 4
Dangar332
Super User
Super User

hi, @Anonymous 

 

remove () after Day
Lag = DATEDIFF(CALCULATE(MAX(cr93f_cpsoo[Physical Date]), cr93f_cpsoo[Terms Approved DateTime]),DAY )

Anonymous
Not applicable

Hi @Dangar332 

 

When I remove () after Day it gives me this error:

 

Too few arguments were passed to the DATEDIFF function. The minimum argument count for the function is 3.

hi, @Anonymous 

Lag = 
DATEDIFF(
        MAX(cr93f_cpsoo[Physical Date]),
        max(cr93f_cpsoo[Terms Approved DateTime]),
        DAY
  
)

Anonymous
Not applicable

Hi @Dangar332 

It worked! Thank you! What is the best way to present these findings in a visual?MaxTermsLag.PNG

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.

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.