Forum Discussion

kapildua16's avatar
kapildua16
Helper I
1 year ago
Solved

Conditional Formatting Dax

Hi Anonymous  I need some help in defining logic for confitional formatting for matrix visual I have below data Row Labels Sunday Monday Tuesday Wednesday Thursday Friday Saturday 7 A...
  • Akash_Varuna's avatar
    1 year ago

    Hi kapildua16 Another way is through a measure you could also try if you want 

    1. Create a DAX Measure: Define a measure that assigns a numeric category (1–5) based on the value in the matrix.

      PercentileCategory = 
      VAR CurrentValue = SELECTEDVALUE(MatrixTable[Value]) -- Replace with your column name
      RETURN 
          SWITCH(
              TRUE(),
              CurrentValue < 27, 1,        -- 0-20%
              CurrentValue <= 37.4, 2,    -- 21-40%
              CurrentValue <= 52, 3,      -- 41-60%
              CurrentValue <= 95.2, 4,    -- 61-80%
              TRUE(), 5                   -- 81-100%
          )
    2. Apply Conditional Formatting:

      • Go to your matrix visual, select the field you want to format, and navigate to Conditional Formatting > Background Color.
      • Choose Format by: Field Value.
      • Select the PercentileCategory measure.
      • Assign colors to categories:
        • Category 1 (0–20%): Light color.
        • Category 2 (21–40%): Slightly darker shade.
        • Category 3 (41–60%): Medium color.
        • Category 4 (61–80%): Darker color.
        • Category 5 (81–100%): Bright or bold color.
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, kapildua16 

    I wish you all the best. Previously MattiaFratello and Akash_Varuna have provided a solution to help you solve the problem. Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
    If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
    If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
    Thank you for your patience and look forward to hearing from you.

     

     

    Best Regards

    Jianpeng Li