✅ Why this blog?
As of now, I couldn’t find a solid blog or solution that clearly addresses how to show total values when nothing is selected from a Matrix Table .Since this is a frequent question in the Power BI community, I decided to write this step-by-step guide to help others looking for the same solution.
Step 1: Create a new support Table
Table B =
UNION(
DISTINCT(SELECTCOLUMNS('Table A', "Product", 'Table A'[Product])),
ROW("Product", "All")
)
Step 2: Create Relationship
Go to Model view and create a relationship:
- From: Table A[Product]
- To: Table B[Product]
- Cardinality: Many to one (Table A → Table B)
✅ Make sure this relationship is active.
Step 3: Create Measures
1️⃣ Sales Measure (Total or Filtered)
This measure checks the selected product. If "All" is selected, it returns total sales. If a specific product is selected, it filters accordingly.
Sales Measure =
VAR CurrentProduct = SELECTEDVALUE('Table B'[Product])
RETURN
IF(
CurrentProduct = "All",
CALCULATE(
SUM('Table A'[Sales]),
ALLEXCEPT('Table A', 'Table A'[Region])
),
CALCULATE(
SUM('Table A'[Sales]),
'Table A'[Product] = CurrentProduct
)
)
Selection Flag (For Visual Filter)
This measure ensures the correct rows appear in your visuals:
Selection Flag product =
IF(
ISFILTERED('Table A'[Product]),
IF(
SELECTEDVALUE('Table B'[Product]) = SELECTEDVALUE('Table A'[Product]),
1,
0
),
IF(
SELECTEDVALUE('Table B'[Product]) = "All",
1,
0
)
)
Step 4: Create the Stacked Bar Chart
- Insert a stacked bar chart
- Create a Matrix table with Table A Columns Product, Region, Sales
- Set up the fields:
- Y-axis → 'Table B'[Product]
- X-axis (Values) → Sales Measure
- Legend → 'Table A'[Region]
🔎 Step 5: Apply Visual-Level Filter
To make sure only the selected product (or total) is shown:
- Select the chart.
- Drag the Selection Flag product measure to the Visual-level filters pane.
- Set the filter to "is 1".
🛠 Edit Interactions
- Select the Matrix table.
- Go to Format > Edit Interactions
- For each visual:
- Choose Filter (✅) to apply slicer
✅ Result
- Selecting nothing → chart shows total sales for all products, split by region.
Nothing Selected
Values selected
I have attached the sample Pbix file for your reference