Dashboard Mode - QUERY function basics
Goal
Find out how to use the QUERY function in Google Sheets to filter and sort data easily.
Find out how to use the QUERY function in Google Sheets to filter and sort data easily.
| Product | Category | Price | Sold |
|---|---|---|---|
| Apple | Fruit | 1.2 | 50 |
| Banana | Fruit | 0.8 | 80 |
| Carrot | Vegetable | 0.5 | 40 |
| Broccoli | Vegetable | 1.0 | 30 |
| Orange | Fruit | 1.1 | 60 |
| Potato | Vegetable | 0.3 | 100 |
=SUM(D2:D7)=QUERY(A1:D7, "select A, C, D where B = 'Fruit'", 1)=QUERY(A1:D7, "select A, B, D where D > 50 order by D desc", 1)+----------------------+--------------------------+ | Total Sold | Fruits Only Table | | (KPI) | | | 360 | Product | Price | Sold | +----------------------+--------------------------+ | Products Sold > 50 Table | | Product | Category | Sold | | Potato | Vegetable| 100 | | Banana | Fruit | 80 | | Orange | Fruit | 60 | +-------------------------------------------------+
Add a filter dropdown for Category (Fruit, Vegetable). When you select a category, the Fruits Only Table and Products Sold > 50 Table update to show only products from that category. The Total Sold KPI also updates to sum only the sold units for the selected category.
If you add a filter to show only Vegetables, which components update and what do they show?