Forum Discussion

Sonu88's avatar
Sonu88
Frequent Visitor
1 year ago
Solved

Unable to Apply Grey Color for Inactive Slicer Values Using DAX

Hello experts,   I have a table with two columns: Country and City, and I'm using the Country column as a slicer with multi-selection enabled. Based on the selected countries, the corresponding cit...
  • Jpss's avatar
    1 year ago

    Sonu88 
    If i understand your requirement correctly, this is the solution you are expecting : 

    here is the link to the pbix file for your reference. Slicer button custom colors.pbix

     

    with the new slicer, we can control the colors when they are in selected state or in Default state ( which is when they are not selected)

    i made following updates in the settings : 

     

    for multi colors based on country name,  i created a measure and used it in the settings when "state" is "selected"

     

    CountryColor = 
    SWITCH(TRUE(),
            SELECTEDVALUE(Countries[Countries]) = "India", "Red",
            SELECTEDVALUE(Countries[Countries]) = "United Kingdom", "Green",
            SELECTEDVALUE(Countries[Countries]) = "USA", "Blue")

     

    remember, for specific colors, you can use hex code aswell instead of writing generic color name

     

    do use this measure; Click the "fx" button  under the fill section when State is "Selected"

     

    in the format style, select "field value",  and then select the measure

     

    this gives the desired output