Forum Discussion
Expression.Error: The specified sort criteria is invalid
Hi folks, integrating a simple 2 field query and receiving the error;
"Expression.Error: The specified sort criteria is invalid"
I suspect the fact that I'm using CAST for the date field may be an issue, however I have no problem running it in SQL and the data does appear in my BI form...any thoughts?
SELECT
CAST([TRSAddedTime] as Date) as Date
,count([TRSSubmitCount]) as Trans
FROM
AdminLevel.dbo.tblTransStorage
WHERE
TRSAddedTime >= Dateadd(day, -30, getdate())
Group By
CAST([TRSAddedTime] as Date)
,[TRSSubmitCount]
Order By Date Desc
Thank you Xiaoxin, I was able to find a work around. I removed the "Cast" function within the SQL statement and used Power BI to convert the data type to "Date" for that field. Doing this allowed me to format the report as I needed. Thanks.
2 Replies
- AnonymousNot applicable
Hi AffirmSupport,
Your query seems well, did you use the direct query mode to connect the sql database? If as I said, there are some limitations on direct query mode, you can use import mode and test again.
If above is not help, can you provide more detail information about your issue?(e.g. screenshots, connect mode, detail steps...)
Regards,
Xiaoxin Sheng- AffirmSupportNew Member
Thank you Xiaoxin, I was able to find a work around. I removed the "Cast" function within the SQL statement and used Power BI to convert the data type to "Date" for that field. Doing this allowed me to format the report as I needed. Thanks.