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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Different Number of Rows in SQLServer and PowerBi Query

Hi Everyone,

 

I have encountered an odd error where a query in SQL Server and the same query in PBI are returning different results. For example, this query in SQLServer :

 

SELECT Count(*) FROM Contract WHERE Contract.IssueNumber = 1 AND Contract.ContractCreateDate > '01/06/2020'

 

Returns 251 rows (this is what is expected) but importing the contract table and filtering by IssueNumber and ContractCreateDate is giving me only 214 rows. This is a very simple query so I'm kind of lost as to where I went wrong. Can anyone give me any pointers on this? 

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Hope this post could help you: Rows missing in imported data from SQL-Connection (Power BI desktop).

 



I managed to solve the issue and it indeed had to do with the column formating. The data format for the matching columns in the query merge were data type 'Any' for both columns.

 

For some reason most rows matched except a few rows apparently having a different format. I changed the format of the matching ID columns to 'Text' which solved the issue.




 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

aj1973
Community Champion
Community Champion

Hi @Anonymous 

Check if there is a limit of data imported from SQL server into Power BI. Sometimes there is a limit of 2000 Rows in SQL server therefore the countrows in power bi will be different as it could be missing some rows.

 

Your issue might be similar to this one

https://community.powerbi.com/t5/Desktop/Power-BI-missing-some-data-from-SF-report/m-p/1187374#M533137

 

Regards  

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors