Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi I have a matrix and I have a bar chart.
When I click on one or more items in the matrix i want the chart to show each clicked item individually.
if I don't click on an item i want one line that shows total in chart.
I've used copilot and other help tools but can't find a solution.
Any help is appreciated....
--Steven
Solved! Go to Solution.
Hi @StevenT , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.
Hi @StevenT
Are you looking for an output similar to this ?
If this is what you need please follow the following steps
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:
Make sure this relationship is active.
Step 3: Create Measures
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
Step 5: Apply Visual-Level Filter
To make sure only the selected product (or total) is shown:
Edit Interactions
That should be it , and it should work
I have attached the sample pbix file for your reference
That worked great! Thank you!
Hi @StevenT
What you want is doable by using a measure that changes based on what’s selected in your matrix.
Try creating a measure like this for your bar chart:
Chart Value =
IF(
ISFILTERED('YourTable'[YourColumn]),
SUM('YourTable'[Value]),
CALCULATE(SUM('YourTable'[Value]), ALL('YourTable'[YourColumn]))
)
Just replace 'YourTable'[YourColumn] with the field you use in the matrix and 'YourTable'[Value] with the numbers that you want summed together.
Also make sure that the visuals are set to filter each other.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
Thanks for this suggestion. Unfortunately in my matrix, if I unclick all selections in the matrix, the line chart shows everything as a separate line.
Ultimately I want to be able to show the grand total when nothing is clicked in the matrix.
What I did with your measure is replace the sales with your measure, and I basically got the same thing that I would have if I just left sales there.
Maybe there's more to it than just the measure?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |