Dashboard Mode - CALCULATE function introduction
Business Question
How can we find total sales for a specific product category using a flexible formula?
How can we find total sales for a specific product category using a flexible formula?
| OrderID | ProductCategory | SalesAmount | Region |
|---|---|---|---|
| 1001 | Electronics | 200 | East |
| 1002 | Clothing | 150 | West |
| 1003 | Electronics | 300 | East |
| 1004 | Furniture | 400 | South |
| 1005 | Clothing | 100 | West |
| 1006 | Electronics | 250 | North |
Total Sales = SUM(Sales[SalesAmount])Electronics Sales = CALCULATE(SUM(Sales[SalesAmount]), Sales[ProductCategory] = "Electronics")+-------------------+-------------------+ | Total Sales | Electronics Sales | | (KPI) | (KPI) | +-------------------+-------------------+ | Bar Chart: Sales by Category | | | +---------------------------------------+ | Table: Sales Details | | | +---------------------------------------+
A slicer for ProductCategory lets you filter the whole dashboard. Selecting a category updates the KPI cards, bar chart, and table to show only that category's sales.
If you add a filter for ProductCategory = Clothing, which components update and what is the new Electronics Sales KPI value?
Answer: The KPI cards, bar chart, and table update. The Electronics Sales KPI shows 0 because no Electronics sales remain after filtering for Clothing.