FormulaCamp
Completed
16. Professional Excel Engineering · Performance and Integration · 25 min

6. Excel, Power BI, and SQL

Lesson 6 of 7
Task 1 of 4
  1. In E2:E11, do the JOIN: look up each product category by code from the lookup table K2:L4.

Lesson theory

When data grows to millions of rows and dozens of people need the report, Excel works alongside a database and Power BI:

  • SQL is the query language for databases. Data lives in tables, and a query selects and groups it on the server;
  • Excel connects to a database through Data › Get Data (Power Query) and brings back only the already filtered result;
  • Power BI uses the same data model and the DAX language as Power Pivot in Excel, but publishes interactive reports to the cloud with access permissions and scheduled refresh. Excel stays the analysis tool "on your desk," and Power BI is the storefront for everyone else.

The parts of a SQL query map neatly onto Excel functions:

SELECT o.region, SUM(o.amount), COUNT(*)
FROM orders o
JOIN products p ON p.code = o.product   -- like VLOOKUP by code
WHERE o.year = 2026                      -- the SUMIFS condition
GROUP BY o.region                        -- the rows of the summary table
HAVING SUM(o.amount) > 3000;             -- filter on the total

Repeat this query with formulas. The year and the HAVING threshold are parameters in G7 and G8.

Test yourself

1. Which part of SQL corresponds to a SUMIFS condition such as "year = 2026"?
2. How does HAVING differ from WHERE?
3. What do Power BI and Power Pivot in Excel have in common?
4. Why is it better to do heavy filtering in a SQL query rather than in Excel?

Practice is part of Pro

The live spreadsheet, task checking and .xlsx files in all 170 lessons. Your progress is saved in this browser; sync across devices is coming soon.