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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
VanThuan
Frequent Visitor

SSAS Tabular fails to process table with filter when using ODBC: Incorrect number of parameters

Hi Community,

I'm experiencing an issue with SSAS Tabular (Visual Studio) when connecting to a data source via ODBC driver (Simba Trino).

Environment

- Visual Studio with SSAS Tabular project
- ODBC (Simba trino)
- Data source: Deltalake

 

Problem

When I create a table using Power Query (M) without a filter, the table processes successfully. However, when I add a filter step, processing fails with this error:

Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] ODBC: ERROR [HY000] [Simba][Trino] (1060) Trino Query Error: line 1:1: Incorrect number of parameters: expected 3 but found 0 (80).'

M Query (Failing)

let
Source = #"Odbc/dsn=My_Trino_PPR",
Test_Database = Source{[Name="Test",Kind="Database"]}[Data],
gold_Schema = bec_Database{[Name="gold",Kind="Schema"]}[Data],
client_Table = gold_Schema{[Name="client",Kind="Table"]}[Data],
#"Filtered Rows" = Table.SelectRows(client_Table, each ([client_id] = 4 or [client_id] = 5 or [client_id] = 6))
in
#"Filtered Rows"

 

What I've Tested

- Excel with the same ODBC connection and same query: Works
- SSAS Tabular without filter step: Works
- SSAS Tabular with filter step: Fails

 

My Analysis

It appears that SSAS Tabular's mashup engine generates a parameterized SQL query (with ? placeholders) but fails to pass the actual parameter values to the ODBC driver. The error confirms Trino expects 3 parameters but receives 0.

 

Questions

1. Is there a setting in Visual Studio or SSAS Tabular to fix parameterized query handling with ODBC sources?
2. Is this a known limitation of the Analysis Services mashup engine?

Thanks in advance for any guidance!

1 ACCEPTED SOLUTION
v-kpoloju-msft
Community Support
Community Support

Hi @VanThuan

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @ibarrau, for those inputs on this thread.

This behaviour is related to how SSAS Tabular handles query folding with ODBC sources. When you add a filter step in Power Query, the mashup engine tries to push that filter down to the data source by generating a parameterized SQL query (using ? placeholders). In your case, the Simba Trino ODBC driver expects parameter values but does not receive them correctly, which results in the “Incorrect number of parameters” error. Currently, there isn’t any setting in SSAS Tabular or Visual Studio to control or fix this parameter binding behaviour.

As a workaround, you can avoid this issue by either preventing query folding or by bypassing parameterization completely. The most reliable options are add Table.Buffer before applying the filter so the filtering happens locally instead of being pushed to Trino, or use a native SQL query via Odbc.Query with the filter written directly in SQL (e.g., WHERE client_id IN (4,5,6)), which avoids parameter placeholders entirely and usually provides better performance.

Refer these links:
1. https://learn.microsoft.com/en-us/power-query/odbc-parameters 
2. https://learn.microsoft.com/en-us/sql/odbc/microsoft/limitations?view=sql-server-ver17

Hope that clarifies. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

View solution in original post

6 REPLIES 6
v-kpoloju-msft
Community Support
Community Support

Hi @VanThuan

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @ibarrau, for those inputs on this thread.

This behaviour is related to how SSAS Tabular handles query folding with ODBC sources. When you add a filter step in Power Query, the mashup engine tries to push that filter down to the data source by generating a parameterized SQL query (using ? placeholders). In your case, the Simba Trino ODBC driver expects parameter values but does not receive them correctly, which results in the “Incorrect number of parameters” error. Currently, there isn’t any setting in SSAS Tabular or Visual Studio to control or fix this parameter binding behaviour.

As a workaround, you can avoid this issue by either preventing query folding or by bypassing parameterization completely. The most reliable options are add Table.Buffer before applying the filter so the filtering happens locally instead of being pushed to Trino, or use a native SQL query via Odbc.Query with the filter written directly in SQL (e.g., WHERE client_id IN (4,5,6)), which avoids parameter placeholders entirely and usually provides better performance.

Refer these links:
1. https://learn.microsoft.com/en-us/power-query/odbc-parameters 
2. https://learn.microsoft.com/en-us/sql/odbc/microsoft/limitations?view=sql-server-ver17

Hope that clarifies. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

Hi @VanThuan

Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

Thank you.

Hi @VanThuan

Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

v-kpoloju-msft
Community Support
Community Support

Hi @VanThuan

Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to @ibarrau,  for those inputs on this thread.

Has your issue been resolved? If the response provided by the community member @ibarrau,  addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

Thank you for using the Microsoft Community Forum.

Hi @VanThuan

Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

Thank you.

ibarrau
Super User
Super User

Hi. SSAS doesn't have the same mashup engine as excel or power bi, it's kind of older. I'm wondering if it might be trying to fold the query but can't do it. Maybe if we force prevent that filter buffering the table.

Try this:

let
Source = #"Odbc/dsn=My_Trino_PPR",
Test_Database = Source{[Name="Test",Kind="Database"]}[Data],
gold_Schema = Test_Database{[Name="gold",Kind="Schema"]}[Data],
client_Table = gold_Schema{[Name="client",Kind="Table"]}[Data],
NoFold = Table.Buffer(client_Table),
Filtered = Table.SelectRows(NoFold, each ([client_id] = 4 or [client_id] = 5 or [client_id] = 6))
in
Filtered

Otherwise the only alternative I can think about is running a native query, can you write a native query to that souce? something like:

Odbc.Query("dsn=....", "Select * .... where client_id IN (4,5,6) ")

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.