Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
8 | |
7 | |
6 |