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
gardrich
Regular Visitor

Using results of one query to feed another query - over 1000

I have a query, let's call it query A that runs on server A. I use the results from query A to pull data using query B on server B. The two servers dont' communicate (server A is Microsoft SQL Server, server B is Oracle). I followed the steps outlined in this post: https://community.fabric.microsoft.com/t5/Desktop/Using-results-of-one-query-to-feed-another-query/t... and it worked perfectly in testing a small number of results from query A. However, when I expand to over 1000 results from query A I receive error ORA-01795 on query B because the number of results from query A is more than oracle allows in the WHERE clause.

 

In theory I need to split my results from query A into groups of 1000 and update the WHERE clause in query B to say "where results in (1,2,3,...,1000) or results in (1001,1002,1003,...,2000)" etc. Of course this needs to be dynamic since the number of results will grow over time. The problem is I'm not sure how to do that in Power BI. Is it possible?

 

TIA

Rich

2 REPLIES 2
SivaMani
Resident Rockstar
Resident Rockstar

@gardrich, If your filter column is not text and continuous value, you could try using BETWEEN minValue and MaxValue, let's say WHERE results BETWEEN 1 and 1000.

Thanks for replying. I forgot to mention that my filter column is text. 

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.