cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtzvictor Frequent Visitor
Frequent Visitor

SELECT TOP Expression.Error: The 'offset' argument is out of range.

Hi, I'm trying to run a query that looks like below.

 

select TOP 1 * from c where c._ts >1535611747
order by c._ts DESC

 

In Portal Azure, works fine but trying from Powerbi desktop power query is giving me the following error

 

Expression.Error: The 'offset' argument is out of range.
Details:
-1

 

Any Ideas?

 

Thanks

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: SELECT TOP Expression.Error: The 'offset' argument is out of range.

@mtzvictor,

 

The latest version of Power BI Desktop seems to work for me.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mtzvictor Frequent Visitor
Frequent Visitor

Re: SELECT TOP Expression.Error: The 'offset' argument is out of range.

Really? interesting, 

I have Version: 2.61.5192.601 64-bit (August 2018) and still doesn't work. 

I'm not sure if i said it before but i'm trying to connect to a Azure Cosmos DB. 

 

Highlighted
beneuto Regular Visitor
Regular Visitor

Re: SELECT TOP Expression.Error: The 'offset' argument is out of range.

Error is in Nov 2018 update as well.    I believe this is an issue with Cosmos DB or possibly OLEDB.   It appears that the error is coming from Power BI or the driver trying to parse the query rather than just sending it to Cosmos directly.

 

Vote for the following idea if you think this should be fixed:

 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/34740922-support-top-and-order-by...

 

DjayAr Frequent Visitor
Frequent Visitor

Re: SELECT TOP Expression.Error: The 'offset' argument is out of range.

I encountered the same problem, but not using the TOP statement. Further analysis showed that removing the 'order by c._ts DESC' clause did solve it for me. Of course, with a TOP statement ordering may be more is of importance - and I have not yet checked other columns than _ts.