During data preparation in Power Query, you connect to a SQL Server view that returns columns CustomerID, SalesDate, and LineTotal. You must create a table that lists each CustomerID together with the sum of LineTotal and the number of transactions. The result has to be produced in a single transformation step, stay query-foldable, and avoid extra queries. What should you do?
Add a Table.Buffer step before applying Table.Group to aggregate LineTotal and transaction count.
Duplicate the query, use one duplicate to Group By and sum LineTotal, use the other to Group By and count rows, then merge the results.
Open the Group By dialog, switch to Advanced, group on CustomerID, and add two aggregations in the same step: Sum of LineTotal and Count Rows.
Load the view without transformations and create a DAX table with the SUMMARIZE function to calculate the totals and counts.
The Group By dialog in Advanced mode lets you add multiple aggregations in a single step. By grouping on CustomerID and adding a Sum aggregation for LineTotal and a Count Rows aggregation, Power Query generates a single Table.Group step that SQL Server can execute, so folding is preserved. Duplicating queries or using DAX would add extra steps, and buffering the table forces the data to be loaded locally, which breaks folding.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is query folding in Power Query?
Open an interactive chat with Bash
How does the Group By dialog in Advanced mode work in Power Query?
Open an interactive chat with Bash
What happens if query folding is broken?
Open an interactive chat with Bash
Microsoft Power BI Data Analyst
Prepare the data
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .