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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
sadafrakshan
New Member

Fabric Data Agent on Ontology Fails for Simple and Multi‑Entity Queries (GROUP BY/Aggregation Error)

Hi,

I’ve created a Fabric Data Agent using an Ontology as the data source, and I’m encountering consistent failures even when asking simple questions related to a single entity. Queries that span or join multiple entities also fail.

Below are the details and the error output.

Issue Summary

When I ask a basic question (even involving only one entity), the agent returns an error.
For multi-entity questions, it fails with the same pattern.

The error indicates that the generated Ontology query includes invalid aggregation or grouping logic. Specifically, a field is referenced without being part of the GROUP BY clause or wrapped in an aggregation function.

 

The underlying generated query seems to have a syntax or grouping issue and cannot execute.

 

Query Output:

Failed to execute step (RAID: 36eb1c04-9e56-4998-89ac-a9a56919482d).
Error: Failed to execute Ontology query with error:
"The query is invalid. Reason: BadRequest. Resource: Graph query (graphModelId=9231e6f0-87b9-44b4-9a36-5ddbe39b8d78).
InternalCode: 42000. Message: syntax error or access rule violation.
Cause: data exception; The identifier node_production_plant.plant_id cannot be used, as it is neither part of the GROUP BY nor an aggregation."

I have already enabled "Support GROUP BY in GQL" in the Data Agent instructions.

 

What I need help with:

  • Has anyone seen similar Ontology-based Data Agent failures related to GROUP BY or aggregation?
  • Is this a known limitation or bug when using Fabric Data Agent on Ontology models?
  • Any best practices or modeling patterns to avoid such query-generation errors?
  • Are there known workarounds to ensure the agent produces valid Ontology queries?error.png

 

I can share more examples or screenshots if needed.
Thanks in advance for any guidance!
2 REPLIES 2
arabalca
Solution Supplier
Solution Supplier

Hi @sadafrakshan ,if this helped you, I’d appreciate it if you could mark it as the accepted solution and give it a like 👍
This helps others in the community find the answer more easily.
Thanks! 

arabalca
Solution Supplier
Solution Supplier

Hi @sadafrakshan ,

The issue could be that it is not able to perform the GROUP BY using GQL. This may happen if the Graph feature is not enabled in the administration settings, so I would recommend checking that, as it could be an important point.
Since the agent is using an ontology, it relies on GQL rather than SQL, which is what it would use when querying a Lakehouse directly. As a test, you could try the same question directly against the specific Lakehouse table and compare the behavior.
From your message, I understand that the data agent itself works correctly without the ontology, and that it also works with other types of questions. Is that correct?
If this helped you solve the issue, please mark the response as accepted.
Best regards,

Helpful resources

Announcements
April Fabric Update Carousel

Fabric Monthly Update - April 2026

Check out the April 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.

Top Solution Authors
Top Kudoed Authors