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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
amirthaP
Frequent Visitor

Partitioning in direct Query mode

Hi all,
I am trying to connect a partitioned table with partition projection in athena to powerbi using direct Query mode
But I am getting this ERROR: 
DataSource.Error: ODBC: ERROR [HY000] [Simba][Athena] (1040) An error has been thrown from the AWS Athena client. Error Message: CONSTRAINT_VIOLATION: Injected projected partition column id must have only (and at least one) equality conditions in the WHERE clause!
Basically there should be a where clause with partition key's value

How to include that from powerbi??
or is there any other way to include partitioning in direct query mode

please suggest!

 

2 REPLIES 2
Anonymous
Not applicable

Hi @amirthaP 

 

The error message "CONSTRAINT_VIOLATION: The injected projected partition column ID must have only one (and at least) equal condition in the WHERE clause" indicates that AWS Athena requires a specific condition in the WHERE clause to be related

To address this issue in Power BI with DirectQuery mode, you can try the following approaches:

1. Modify the Query in Power BI:

  • When setting up your DirectQuery connection in Power BI, you usually have the option to specify a custom SQL query.
  • In this custom query, make sure to include a WHERE clause that specifies a condition for the partitioned column.
  • This can be a static value, or if you need more flexibility, you might consider creating a parameterized query in Power BI, though this may have some limitations in DirectQuery mode.

2. Use Power BI Parameters:

  • Power BI allows you to create parameters that can be used in your queries.
  • You can create a parameter corresponding to the partition key and use this parameter in your WHERE clause.
  • Note that using parameters in DirectQuery mode has some restrictions, and it might not be as dynamic as in Import mode.

3. View or Table in Athena:

  • Another approach could be to create a view or intermediate table in Athena that already includes the necessary WHERE clause.
  • This way, you can connect Power BI to this view or table directly without needing to modify the query in Power BI.
  • This approach can be more manageable if you have a common set of partitions you query against frequently.

 

 

 

Best Regards,

Jayleny

 

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

vanessafvg
Super User
Super User

from what your error is saying it sounds like you have overlapping partitions?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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
Top Kudoed Authors