cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmreel1
Frequent Visitor

Find the difference between two dates from two different tables

I am looking to find the difference between two dates from two different tables. The tables being used are Assignments and AssigmentBaselines. The columns used are 'Assignments[AssignmentActualFinishDate] and 'AssignmentBaselines'[AssignmentBAselineFinishDate]. The tables have a relationship many to one (*:1) and has a both cross filter direction. 

 

Screenshot 2023-06-07 110718.pngScreenshot 2023-06-07 110736.png

 

Screenshot 2023-06-07 111257.pngScreenshot 2023-06-07 111301.png

The formula I have been using is: 

Baseline Days +/- = DATEDIFF(AssignmentBaselines[AssignmentBaselineFinishDate], RELATED(Assignments[AssignmentActualFinishDate].[Day]))
 
The error I keep getting is "Too few arguments were passed to the DATEDIFF function. The minimum argument count for the function is 3."
 
I have looked through many different forum post and I have tried many different ways to solve this issue but I keep coming up short. Any help would be appreciated. 
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @jmreel1 

please try

Baseline Days +/- =
DATEDIFF (
AssignmentBaselines[AssignmentBaselineFinishDate],
RELATED ( Assignments[AssignmentActualFinishDate] ),
DAY
)

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @jmreel1 

please try

Baseline Days +/- =
DATEDIFF (
AssignmentBaselines[AssignmentBaselineFinishDate],
RELATED ( Assignments[AssignmentActualFinishDate] ),
DAY
)

I am no longer getting any errors, but the data is not auto filling into the columns. Screenshot 2023-06-07 121726.pngScreenshot 2023-06-07 121722.png

I guess it just took some time. As of right now, it seems like that fixed the issue. Thank you for the help. I was banging my head against the wall for too long. 

@jmreel1 

This is a bug in the latest update. Just manually resize the column and the values should appear. 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors