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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.