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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Frauke
Frequent Visitor

Not all rows loading in Power Query

Hello,

 

I'm pulling data from a system-DSN into PowerQuery with the following query:

= Odbc.Query("dsn=PEO-OdooLive", "SELECT * FROM mail_message WHERE [id] > 0")

 

Eventough I cleary select all, it's not loading all the rows.

With the above query I get only 4592 rows with highest id = 7081

 

However, when I change the query to:

= Odbc.Query("dsn=PEO-OdooLive", "SELECT * FROM mail_message WHERE [id] > 10000")

I get 4861 different rows with lowest id = 10010 and highest id = 15825

 

= Odbc.Query("dsn=PEO-OdooLive", "SELECT * FROM mail_message WHERE [id] > 7081 and <= 10000")

I get 1579 different rows with lowest id = 7082 and highest id = 10000

 

I'm really puzzled as to why this is happening and the only solution I can think of is to split my query into id-ranges, but the highest id I've found is 261145 and I get about 4500-5000 rows with one query, so it would quite a hassle and not a sustainable solution, since the table will keep growing.

 

Does anybody have an idea to what might be causing this?

 

2 REPLIES 2
JoeBarry
Solution Sage
Solution Sage

Hi @Frauke 

 

Have you tried removing the where statement?

 

Joe

Hi Barry,

 

Thanks for your reply.

My original query was without the WHERE statement, this gives the same result as the first query in my question (WHERE id >0)

 

I've tried the crappy solution I've mentioned earlier for id's to 100k, so I've created 20 queries for each range of 5000 id's and combined those queries into a new query, which gives me the expected result in PowerQuery. But if I try to load this I get an error message:

Frauke_0-1694000915540.png

 

What I need from the mail_message table are the values from column "create_date" for all message_id in another table "crm_messages".

Therefor I've also tried to get just the two columns [id] and [create_date] but this gives me the same number of rows.

 

I wish I could give some more information, but I haven't got a clue what more to mention.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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