Forum Discussion
Slicer to Change Column Donut Chart Utilizes
- 7 years ago
okay slightly diffrent to what was in the orginal.
the way i gave you is to swap the value in the filed but you want to swap the dimention
For this you need a 3rd table called catagories as below
Catagories
5 - 10 <5 >10 this will then be joined to both your sales and cost cat colunms (make both joins non active)
then use the measure below
Measure = var sv = SELECTEDVALUE(table2[Type]) var c = CALCULATE(count(Table1[COSTS CAT]),USERELATIONSHIP('Table'[Catagories],Table1[COSTS CAT])) var s = CALCULATE(count(Table1[SALES CAT]),USERELATIONSHIP('Table'[Catagories],Table1[SALES CAT])) var ret = SWITCH(sv, "Sales",s, "Costs",c ,0) Return retsimply put this is doing the same as before looking at the selected value in the none joined type table and then will swap between two measures "s" and "c" these two measures will do a count of the costs cat and sales cat Filed and will switch the join based on the relation ship that is needed
the out come is below
Hi jbc22 ,
Replace the SUM by COUNT:
Pie Chart Value =
SWITCH (
SELECTEDVALUE ( DisconnecteTable[Column] );
"Sales"; COUNT( Table[Sales] );
"Cost"; COUNT ( Table[Cost] );
SUM ( Table[Sales] )
)
Regards,
MFelix
Awesome! I edited the format a bit to handle two different legend values for each of the columns in question and it works like a charm! Thanks!