Reputation: 841
var DateLowest=Min(DateSelector[YearDate]) --- ( 01/01/2020 00:00:00 VALUE )
var rest=
CALCULATE (
AVERAGEX(
VALUES(AppUser[AppUserId]),
DATEDIFF(AppUser[LastLogin],AppUser[CurrentDate],SECOND)
),
FILTER('Date','Date'[DateId]<=SELECTEDVALUE('DateSelector'[DateId],MAX('DateSelector'[DateId])) ), FILTER ( 'AppUser','AppUser'[LastLogin] >= DateLowest
))
RETURN rest
I wish to exclude the AppUser[LastLogin] that are equal to 30/12/1899 00:00:00 GMT+0000 (Greenwich Mean Time). It seems that in Direct Query the DAX is more restrictive and cant cope with additional filtering so looking for another way. The above additional clause in the measure above does not work and causes Power BI to throw this error out .
The service has encountered an error processing your request. Please try again. Error code 8632. A severe error occurred on the current command. The results, if any, should be discarded.. The exception was raised by the IDbCommand interface.
I assume I will need to rewrite this in another way . Any ideas as I seem to have tried 4 or 5 things ?
Upvotes: 0
Views: 797
Reputation: 841
A cheeky IF in the DATEDIFF sorted this .
IF(AppUser[LastLogin]=DATE(1899,12,30),blank(),AppUser[LastLogin]
Case closed.
Upvotes: 1