Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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
Solved! Go to Solution.
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.
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
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.