Forum Discussion
Switch colour formatting via user choice
- 3 years ago
Hi dapperscavenger ,
You can create a disconnected table with "Traditional" and "Inclusive" as rows. Use the field from that table in your slicer. Use SelectedValue to get the selected option. Then use If statement .
Something like this:
Measure=
var _SelectedColor= SELECTEDVALUE(DisconnectedTableName[FieldName])
return
If(_SelectedColor="Traditional", Do the red/green stuff here, Do the red/blue stuff here)
Hi dapperscavenger ,
You can create a disconnected table with "Traditional" and "Inclusive" as rows. Use the field from that table in your slicer. Use SelectedValue to get the selected option. Then use If statement .
Something like this:
Measure=
var _SelectedColor= SELECTEDVALUE(DisconnectedTableName[FieldName])
return
If(_SelectedColor="Traditional", Do the red/green stuff here, Do the red/blue stuff here)
Thanks! This got me started in the right direction
I created a table containing the hex codes, so that in the future if I need to change the colour schemes I can do it for all the formulas in one go by just updating the table
(These are just test hex codes btw):
Added slicer to the visuals with single select only, for the View field
And then called the hex codes with below measure:
Measure =
var _ColPos = CALCULATE(MAX(DimColour[Positive]),FILTER(DimColour,SELECTEDVALUE(DimColour[View]) = DimColour[View]))
var _ColNeg = CALCULATE(MAX(DimColour[Negative]),FILTER(DimColour,SELECTEDVALUE(DimColour[View]) = DimColour[View]))
return
if( [MyOtherMeasure] <=0 ,_ColPos,_ColNeg))