Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello
I have some SQL that runs fine in MS SQL Studio, but will not run in Power Apps (in Excel ver 2402 build 16.0.17328.20550) 64 bit)
The error I get is
DataSource.Error: Microsoft SQL: The identifier that starts with '
SELECT
CASE
WHEN AccountingDate < rca.InternalCommissionCalendarDate AND pbrc.RiskCarrierCode = 'xxx'
THEN 'C' is too long. Maximum length is 128.
Details:
DataSourceKind=SQL
DataSourcePath=insightmarts.xxxxx.com;xxxMart
Message=The identifier that starts with '
SELECT
CASE
WHEN AccountingDate < rca.InternalCommissionCalendarDate AND pbrc.RiskCarrierCode = 'HIC'
THEN 'C' is too long. Maximum length is 128.
ErrorCode=-2146232060
Number=103
Class=15
State=4
or
These are my PQ steps;
Any thoughts without me sharing the SQL statement?
Thanks
Stuart
Solved! Go to Solution.
The fact that the error is coming from the SQL Server means that your steps are correct and the query is getting to the server so the problem is your SQL.
--Nate
Please share your actual (failing) M code with the SQL statement in it. It is probably to do with quoted text inside quoted text.
hi @StuartPQY
I cannot see FROM clause in your SQL statement but maybe you truncated it in post. If not you can check if your SQL completed.
If everything is ok with SQL code I would advise trying query folding. To test it go for this steps:
1. Add your sql server connection string and select table that you would like to transform,
2. Create conditional colum where you add your logic to align with Case statement you want to get
3. Remove all other columns.
The fact that the error is coming from the SQL Server means that your steps are correct and the query is getting to the server so the problem is your SQL.
--Nate
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |