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
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
Anonymous
Not applicable

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.

v-chuncz-msft
Community Support
Community Support

@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.

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

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

 

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.