Forum Discussion

deannapi's avatar
deannapi
Frequent Visitor
2 years ago
Solved

Highlighting background comparing to total

I have a matrix built by Year-Month, Location Name, and a % value from dividing 2 measures.

I want to highlight cells per column if the cell is greater than it's total

 

The datatable looks like the following example  but with multiple years and Locations:

 

 

 

YearMonthLocationValue1Value2
2023JanuaryLocA40193714.33643966.62
2023FebruaryLocA31852406.97912116.34
2023MarchLocA35091429.05767218.08

 

Then I create a measure for Value2 / Value1

Year-MonthLocationA
20232.17%
January1.60%
February2.86%
March2.19%
Total2.17%

I now need to compare each row with it's column total:

   IF each cell is greater than the column Total, then highlight cell red

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi deannapi ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create measures.

    total = CALCULATE([Measure],ALL('Table'))
    color = IF([Measure]>[total],"red")

    (3) Setting the Conditional Format and then the result is as follows.

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi deannapi ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) My test data is the same as yours.

    (2) We can create measures.

    total = CALCULATE([Measure],ALL('Table'))
    color = IF([Measure]>[total],"red")

    (3) Setting the Conditional Format and then the result is as follows.

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.