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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-shex-msft
Community Support
Community Support

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

 

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.