Forum Discussion

Mants's avatar
Mants
Frequent Visitor
1 year ago

Conditional formatting background in table based on measure / calculated column

Dear, 

 

I'm creating a table which will have between 30-60 columns and around 25 rows. I would like the background of each cell to be colored based on specific rules (i.e. larger than x and smaller than y then "red"). the idea is to use the field value option to refer to a column/measure that will be able to provide the rules. 

 

To that end i have tried to create several conditional measures and columns, however everytime these stop evaluating after meeting the first condition, making the whole column only one color, regardless of the value in the cells.

 

Is there something wrong in the formulas or in my thinking? 

 

Both the pbix and an excel with the measures/calculation used (in the original work file) are available here: https://we.tl/t-MDiJ7taiYl

 

Using the calculated column works in the table (visible when viewing the table in the background), however using a calculated column for the field value rule only gives first and last as options and uses only one evaluation for the whole column.

 

I would like to avoid manually creating rules per column, and also expect to be adding rules in the future

 

Any help on this would be appreciated

 

 

 

 

 

 

3 Replies

  • lucadelicio's avatar
    lucadelicio
    Impactful Individual

    Hi Mants probably you have to start to review your dataset because in your power bi you have 1.020 rows instead of 25 you said.
    Create and import the correct dataset then re-publish the pbix to get the help that you need.
    Thank you

     

    • Mants's avatar
      Mants
      Frequent Visitor

      Hi Luca, yes that correct thanks for checking.

      The end result of that table would be a table visual where Order would be pivoted to columsn (1 to 30). 

      Then in that table each cell needs to be formatted, with the challenge presented above.

       

      For the purpose of illustration the end result table visual is created with columns 1 to 11

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Mants 

    May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

     

    If not, please provide more detailed information about your problem, such as calculation logic, expected results. We will do our best to solve your problem.

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.