Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I
Helper I

Cross-Filtering between bar chart and table using measures in bar chart

I needed to have the legend on my chart that does not change based on report filtering so I created measures to calculate the count of ID’s for each Status.  This allowed the legend to stay static no matter what filters are applied to the report page.  The problem I now have is that when I select one of the counts in the bar chart (i.e. Actions Complete for DB1), it no longer filters the table with the same data.  So the measures I created are not allowing any cross-filtering to the table.  One of the measures I created was:


Count of Id for Actions complete =

CALCULATE(COUNTA('Case'[Id]), 'Case'[Status] IN { "Actions complete" })


And I have 7 other measures with different status’s.


The Bar chart has Type for the Axis (which is DB1 and DB2), and each of the measures for values.


The Table shows Type, Status, and a bunch of other values.


Is there a better way to make sure the legend doesn’t change based on filtering or is there a better measure I can write that allows cross-filtering to the table?


Not sure why you would want to confuse your users this way but here's an implementation



View solution in original post

Helper I
Helper I

I agree this isn't ideal but this is what the customer wants... a static legend so they know what other status's are available.  Your suggestion is a good one.  I will take that to them as a solution.  Thanks! 

Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

Sorry for the late reply.  Here is a sample of the data.  This sample is also what would be shown in the Table Graph.  The picture of the bar chart is included.  If I use measures for each status in the bar chart, It no longer filters the table chart.  For instance, if I select "Completed" in the bar chart, the table graph still shows all status's (does not filter just the ones that are "Completed").  I need the legend to stay static so on the main page filters, if someone selects location = MB, the legend in the bar chart stays the same.  

TypeStatusCaseCreated DateLocationID
RoundNew1344937/25/2019 18:22MB12aTgQAI
RoundComplete1344947/25/2019 18:22MB12aTRQAY
RoundComplete1426188/16/2019 0:36B1fuIqQAI
RoundUnder Investigation16765010/10/2019 5:17A3VhnbQAC
RoundComplete17093510/17/2019 8:17A3jWqEQAU
RoundNew17225910/20/2019 21:12MB3lr9uQAA
RoundActions complete2918205/12/2020 4:45SA9UxwKQAS
RoundAwaiting closure2958855/19/2020 2:37SA9jMTwQAM
ChecklistComplete40999311/21/2020 4:39CDpj1gQAB
ChecklistNew4468991/15/2021 10:25WF1gu9QAB
ChecklistComplete4517791/23/2021 18:04S1F47vvQAB
ChecklistComplete4517801/23/2021 18:04S1F47w4QAB
ChecklistNew5163315/8/2021 9:13WHcbg5QAB
ChecklistComplete5284555/29/2021 22:55S29ECdrQAG
ChecklistAwaiting closure67105612/3/2021 14:54GMnkbkQAB
ChecklistUnder Investigation67137612/4/2021 6:03GMnspKQAR



What is your expected outcome?  Here is an example that doesn't use measures at all




How is this insufficient for what you are trying to achieve?  How do you expect users to interact with the visual?



If you have a slicer on the page for Location and you select G, I want the legend to still show everything.  Creating measures allows this to happen but when I then add a table of the data to the page and when I select one of the bars (completed), the table is not filtering to just show completed.  That is the consequence I found with the measures.  It fixes one problem (keeping legend intact) but does not solve the cross filtering function between the table and the bar chart.   Maybe the measures need to be written differently or maybe there is no fix that will keep legend intact and allow the cross-filtering.

Not sure why you would want to confuse your users this way but here's an implementation



Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors