cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtzvictor
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
Community Support

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

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. 

 

Anonymous
Not applicable

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
New Member

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.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors