Forum Discussion

DHeller's avatar
DHeller
Advocate I
3 years ago
Solved

Table conditional formatting based on column not displayed

I want to conditional format a table column based on a column that I do not want to display. It works for some of the lines but for others the conditional format only gets applied if I add the "unwanted" column in the visual... any idea how to fix this?

  • DHeller that's ok. Try to create a Measure to retrieve the latest status from the first column using CALCULATE/MAX, something like that. This way you will have an unique value and then I believe you will be able to use it as text in the conditional formatting.

     

    Unfortunately I cannot help much more without the sample of data/pbix. Sorry about that!

     

    Hope this answer solves your problem!
    If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, please consider marking it as a solution โœ”๏ธor giving it a kudoe ๐Ÿ‘

    Thanks!

    Best regards,
    Joao Ribeiro

13 Replies

  • joaoribeiro's avatar
    joaoribeiro
    Impactful Individual

    Hi DHeller , probably the issue is that, without the unwanted column, the Power BI cannot assign a specific value for the column for some rows that might have multiple values for this column. You can try to use MAX, MIN, or other functions to reduce the range to only one value and avoid this erros.

     

    Can you provide examples, so I can try to help you with the issue?

     

    Thank you!

    • DHeller's avatar
      DHeller
      Advocate I

      joaoribeiro Thanks for input. I seems I do not have the same options to configure my conditional formatting (I don't have the value only). I am using PowerBI desktop.

       

      • joaoribeiro's avatar
        joaoribeiro
        Impactful Individual

        DHeller, please try to change the "Based on field" value to your "Deliverable Status" column, and change the "Summarization" option to "First" instead of "Count". This way, you should have the option to put specific text values ๐Ÿ™‚

         

        Hope this answer solves your problem!
        If you need any additional help please @ me in your reply.
        If my reply provided you with a solution, please consider marking it as a solution โœ”๏ธor giving it a kudoe ๐Ÿ‘

        Thanks!

        Best regards,
        Joao Ribeiro

  • Thanks joaoribeiro for getting back to me. In my data I have a value Deliverable status with 2 values. I have created a second column that returns only the corresponding number (decimal format). Now in my table visual I want to have the first column with a green or red background depending if the value is 1 or 2 but I do not want to display the column with the 1 or 2 values:

    When adding only the first column in the visual, the conditional format is applied to some lines but not all. As soon as I add the second column in the visual, it works for all lines.

    • joaoribeiro's avatar
      joaoribeiro
      Impactful Individual

      Hi DHeller , thanks for the explanation. Can you please share how is your conditional formatting configured?

      Also, why don't you use the first column and the column assigned to the rule? This way you can set background color rules for each text value in the "Deliverable status" column. Check the example below:

       


      Hope this answer solves your problem!
      If you need any additional help please @ me in your reply.
      If my reply provided you with a solution, please consider marking it as a solution โœ”๏ธor giving it a kudoe ๐Ÿ‘

      Thanks!

      Best regards,
      Joao Ribeiro

  • Adamboer's avatar
    Adamboer
    Responsive Resident

    It sounds like the column you do not want to display is still being used in the background of your visual, which is why the conditional formatting is not working correctly for certain rows. To fix this, you can try removing the unwanted column from the background of the visual.

    One way to do this is to go to the Fields pane, find the unwanted column, and drag it out of the visual. Another way is to go to the formatting options for the visual, navigate to the "Data colors" or "Conditional formatting" section, and make sure the unwanted column is not selected as the field to base the formatting on.

    If you have already tried these methods and are still experiencing issues with the conditional formatting, it may be helpful to share more details about your data and visual so that others can better understand the issue and provide more specific guidance.