Step-by-step
Analyze Data is Excel’s AI assistant: it suggests charts and PivotTables and answers questions typed in plain English. The example uses a wholesale customers data set (Channel, Region and annual spending in Fresh, Milk, Grocery, Frozen, Detergents_Paper and Delicassen) and shows both a good answer and a wrong one, and how to fix the data so the answers are right.
1. Open Analyze Data
Click inside the table and go to Home > Analyze Data. A pane opens with suggested insights: PivotTables, bar charts, scatter plots, doughnuts and histograms.
2. Judge the suggestions
Not all of them make sense. One scatter plot treats region numbers as quantities on the X-axis. A better pick is the PivotChart of Delicassen by Channel and Region: click Insert PivotChart to add it to a new sheet.
3. Ask a question
In Ask a question about your data, type What are the total Grocery sales for Region 3? It answers correctly and you can click Insert PivotTable.
4. See where it goes wrong
Ask What are total sales by Region? and it returns Sum of Region, which is nonsense. The cause is the data layout: sales are spread across six columns, and there’s no single Sales column for Excel to add up.
5. Reshape the data with Power Query
Click inside the data and go to Data > From Table/Range. In Power Query, select the Channel column, hold Ctrl and select Region, then right-click and choose Unpivot Other Columns. Rename Attribute to Department and Value to Sales, then Close & Load.
6. Ask again
Click inside the new table, open Analyze Data and ask What are total sales by region? This time you get a proper Sales by Region chart. Good data structure in, good answers out.
Go further
My Excel Power Query, Power Pivot, DAX & Power 3D Map course shows how to shape any data so tools like this give the right answers.