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
akhaliq7
Post Prodigy
Post Prodigy

group by breaks query folding

How to use a alternative method to do a group by without breaking query folding?

1 ACCEPTED SOLUTION

If it breaks, you've no choice but to either let the mashup engine handle it locally, or talk to a DBA into creating a view for you. Power Query folding isn't universal across all sources that support some measure of folding. I'm surprised Oracle doesn't, but then again, not really surprised. That isn't the best connector in the world unfortunately.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

No. It depends on what you are doing specifically. With SQL Server, it does work in many cases. Summing quantity by tracking number in the AdventureWorks DB for example returns this folded query:

select [rows].[CarrierTrackingNumber] as [CarrierTrackingNumber],
    sum([rows].[OrderQty]) as [Total Units]
from 
(
    select [CarrierTrackingNumber],
        [OrderQty]
    from [Sales].[SalesOrderDetail] as [$Table]
) as [rows]
group by [CarrierTrackingNumber]

 

Counting rows works too, as does average. Counting Distinct rows does not - folding breaks.  As does keeping the All Rows aggregation.

And your datasource might be different. Oracle or PostGRE SQL may or may not be supported for some Group By operations.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Yes oracle db 

If it breaks, you've no choice but to either let the mashup engine handle it locally, or talk to a DBA into creating a view for you. Power Query folding isn't universal across all sources that support some measure of folding. I'm surprised Oracle doesn't, but then again, not really surprised. That isn't the best connector in the world unfortunately.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.