Forum Discussion
Invalid OADATE Value
- Anonymous9 years ago
Ok, I wasn't able to share but, we found the error. I needed a DATEDIFF() to convert the dates to numbers so, that solves this issue...but, if I have more than one record that changed over the time the report is sliced , it is adding a day...still troubleshooting that one.
Capacity *Generated Days = VAR Start_Date = MIN('DIM Calendar'[Date])
VAR End_Date = MAX('DIM Calendar'[Date])
RETURN
CALCULATE(SUMX('MDS FleetAttributes',
( DATEDIFF(IF('MDS FleetAttributes'[EffectiveDate]>=Start_Date,
'MDS FleetAttributes'[EffectiveDate],
Start_Date),
IF('MDS FleetAttributes'[TerminationDate]<End_Date,
'MDS FleetAttributes'[TerminationDate],
End_Date),
DAY))
*'MDS FleetAttributes'[Truck Capacity]),
FILTER('MDS FleetAttributes',
'MDS FleetAttributes'[EffectiveDate]<End_Date),
('MDS FleetAttributes'[TerminationDate]>=Start_Date))
Ok, I wasn't able to share but, we found the error. I needed a DATEDIFF() to convert the dates to numbers so, that solves this issue...but, if I have more than one record that changed over the time the report is sliced , it is adding a day...still troubleshooting that one.
Capacity *Generated Days = VAR Start_Date = MIN('DIM Calendar'[Date])
VAR End_Date = MAX('DIM Calendar'[Date])
RETURN
CALCULATE(SUMX('MDS FleetAttributes',
( DATEDIFF(IF('MDS FleetAttributes'[EffectiveDate]>=Start_Date,
'MDS FleetAttributes'[EffectiveDate],
Start_Date),
IF('MDS FleetAttributes'[TerminationDate]<End_Date,
'MDS FleetAttributes'[TerminationDate],
End_Date),
DAY))
*'MDS FleetAttributes'[Truck Capacity]),
FILTER('MDS FleetAttributes',
'MDS FleetAttributes'[EffectiveDate]<End_Date),
('MDS FleetAttributes'[TerminationDate]>=Start_Date))
This error message can also result from mismatch in Types. For example, if you're sorting Type Text with Type Decimal. The error message should be a lot clearer.