Forum Discussion

Ian_Stuart_Rupe's avatar
Ian_Stuart_Rupe
Icon for Advocate III rankAdvocate III
2 years ago

Conditionally format text in legend

I want the text of the element to be the same as the marker in the legend so that"Africa" on the below scatterplot would be blue.  Now there is conditional formatting available for this but I cannot get it to work.  I have created a measure as shown below which I am using to set the colour.  This measure works for every other element that I have conditionally formatted.

Region Colour =
VAR SelectedRegion = SELECTEDVALUE(Dim_Country[Region Name])
VAR RegionColour = SWITCH(SelectedRegion,
                        "Africa", "#25CBD3",
                        "Americas","#A66999",
                        "Asia","#EE3A6B",
                        "Europe","#959DA2",
                        "Oceania","#FF9E00"
                    )
RETURN
RegionColour
 
Any ideas?