Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AO1
Frequent Visitor

Keep a bar permanent in Bar chart

Hi Powerbi experts,

I have the below table from which i made the below presentation. I can attach the powerbi file also if you need to play with it to help come up with a solution.

 

ParameterTreatmentScoreCON_value
ATRT11029
ACON2929
ATRT21929
ATRT37229
ATRT43129
BTRT12015
BCON1515
BTRT23115
BTRT34115
BTRT41315
CTRT15446
CCON4646
CTRT23946
CTRT32846
CTRT41646

 

AO1_4-1702769993123.png

 

 

 

I have 2 slicers, one controls the Parameter variable and the other controls the Treatment variable. Is there a way to make one of the Treatment options, "CON" uneditable by the Treatment slicer? I have explored different solutions. Here is the solution i currently have:

- I created 2 graphs of the same size

- I created a new table called "Table CON" with just the Treatment variable, which has just one value, "CON"

AO1_0-1702773496118.png

- I used the Treatment variable of the Table CON as the X-axis variable of one of the graphs, which gives just the CON bar chart

- I edited the Treatment slicer and unchecked "CON" so it is not one of its selectable options

- Problem with this approach is that the maximum value of the y-axis on both graphs cannot be the same, which does not give the needed perspective to compare the CON barchart with the Treatment selected on the barchart controlled by the slicer.

- In effort to resolve that, i created a measure that compares the CON value (CON_value) with the value of the Treatment selected by the slicer. I named the measure "Measure Value for graph". The measure was supposed to return the greater of these 2 values and it works. I tried using this measure as the maximum y-axis value for both charts. This measure however did not transform the CON barchart but it successfully adjusts the other barchart.

AO1_6-1702772966176.png

 

I know slicers don't have the option of keeping an option permanently selected without using multi-select option as shown below:

AO1_2-1702768935591.png

 

I'm just hoping there is some workaround i can do on the data itself or combining 2 graphs to achieve the desired outcome.

@wdx223_Daniel

@slorin 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

try these steps

1 create a table of treatments without CON, and no need add any relationships

wdx223_Daniel_0-1702865053720.png

wdx223_Daniel_1-1702865131042.png

 

2 create a measure as 

ScoreTotal = CALCULATE(SUM('Table'[Score]),KEEPFILTERS(TREATAS(UNION(VALUES('Table Treatments'[Treatment]),{"CON"}),'Table'[Treatment])))

3 create two slicers, one by Table[Parameter], the other by 'Table Treatment'[Treatment]

4 create bar visual, Table[Parameter] in X-axis, and Table[Treatment] in Y, ScoreTotal measure in Value

wdx223_Daniel_2-1702865275438.png

 

 

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

try these steps

1 create a table of treatments without CON, and no need add any relationships

wdx223_Daniel_0-1702865053720.png

wdx223_Daniel_1-1702865131042.png

 

2 create a measure as 

ScoreTotal = CALCULATE(SUM('Table'[Score]),KEEPFILTERS(TREATAS(UNION(VALUES('Table Treatments'[Treatment]),{"CON"}),'Table'[Treatment])))

3 create two slicers, one by Table[Parameter], the other by 'Table Treatment'[Treatment]

4 create bar visual, Table[Parameter] in X-axis, and Table[Treatment] in Y, ScoreTotal measure in Value

wdx223_Daniel_2-1702865275438.png

 

 

@wdx223_Daniel, don't you need a certificate to be this awesome! Your solution worked like a charm. I wish i could give it 1000 likes. Thank you!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.