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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dd96
Frequent Visitor

getting following error while loading Views from sql server to power BI

I am getting following error while loading a View from sql server to power BI. 

I have premium license so storage should not be a problem. would be great if someone can help me to understand this error. 

 

"Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: Invalid length parameter passed to the LEFT or SUBSTRING function.. '."

5 REPLIES 5
dd96
Frequent Visitor

I would like to mentoin that the issue is resolved. 

Thank you 

HI, How did you solve this issue? I am getting the same error.

 

Hi , @dd96 

Glad that you solved the problem, if convenient, can you share the following causes and solutions that cause the problem?

Thank you for your understanding and support of Power BI.

 

Best Regards,

Aniya Zhang

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

dd96
Frequent Visitor

Thanks for the reply but there is no pbix file genered as when trying to load sql view via import this the first error i get. 

v-yueyunzh-msft
Community Support
Community Support

Hi , @dd96 

According to the error message you provide: "Invalid length parameter passed to the LEFT or SUBSTRING function.", It can be seen that the sql statement syntax error is reported when querying the data.

For this kind of problem, you can download the .pbix file and go to the Power Query Editor to see if there is an error message for a step, or see if the SUBSTRING, LEFT and RIGHT functions are causing the error in Power BI Desktop.

For more information , you can refer to :

[Solved] invalid length parameter passed to the left or substring function in sql server - CodeProje...

SQL Server Helper (sql-server-helper.com)

 

Best Regards,

Aniya Zhang

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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