The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Parameter | Treatment | Score | CON_value |
A | TRT1 | 10 | 29 |
A | CON | 29 | 29 |
A | TRT2 | 19 | 29 |
A | TRT3 | 72 | 29 |
A | TRT4 | 31 | 29 |
B | TRT1 | 20 | 15 |
B | CON | 15 | 15 |
B | TRT2 | 31 | 15 |
B | TRT3 | 41 | 15 |
B | TRT4 | 13 | 15 |
C | TRT1 | 54 | 46 |
C | CON | 46 | 46 |
C | TRT2 | 39 | 46 |
C | TRT3 | 28 | 46 |
C | TRT4 | 16 | 46 |
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"
- 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.
I know slicers don't have the option of keeping an option permanently selected without using multi-select option as shown below:
I'm just hoping there is some workaround i can do on the data itself or combining 2 graphs to achieve the desired outcome.
Solved! Go to Solution.
try these steps
1 create a table of treatments without CON, and no need add any relationships
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
try these steps
1 create a table of treatments without CON, and no need add any relationships
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, 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!
User | Count |
---|---|
26 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
30 | |
14 | |
12 | |
12 | |
7 |