Forum Discussion
Anonymous
9 years agoNot applicable
Issue using DateDiff for New column
I have two data tables that are related using ClientID. Each table has two different dates that I need to get the Number of Days between each date, however when I go to build a new column in either ...
- 9 years ago
Anonymous
Hi,
It seems that you made a wrong relationship. One client has a DateOfService and a HealthRecordDate. We should create relationship using ClientId. If you could establish a 1:1 relationship with ClientId, you could use this formula in a measure.
DaysSinceBMI =
DATEDIFF (
MIN ( ClientsServed[DoS] ),
MIN ( v_MostRecentClientHealthData[HealthRecordDate] ),
DAY
)
Don’t worry about MIN. When you create a report like this, there will be only one date each. So MIN() is itself. Please have a try.
ClientId DaysSinceBMI
A 90
Best Regards!
Dale
dedelman_clng
Community Champion
9 years agoPlease let us know what your data model looks like (screen cap would be helpful) and the code you are trying that is failing.