Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AffirmSupport
New Member

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

1 ACCEPTED 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.

View solution in original post

2 REPLIES 2
Anonymous
Not 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

 

 

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors