Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago

Matrix Background Color

Hello! How are they?

I'm needing to get to the next color result in a matrix. The color remains static regardless of the result.

Mery98_0-1653790712706.png

To solve it, what I did was create a column in the query and then put the background conditional formatting according to that column. The drawback is that, for cases where there is no combination, and the cell is blank, I do not take the conditional formatting.

Mery98_1-1653790808711.png

How can I fix it?

Thank you!!

5 Replies

  • Syndicate_Admin 

    In the measure that is used within your matrix, add +0 at the end then adjust your CF logic to suit the results



  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can refer the following threads to get it:

    Display zero instead of blank in matrix


    Hi, you can obtain this view following these steps:

    1.Create a new Table (Modeling-New Table)

    Tablepr=Distinct(Table1[pr]

     

    2. Related both tables

     

    3. Create the Measure to Count IDs

    CountIDs=Count(Table[id]) + 0

    unable to replace blank with zeros in matrix

    As @Fowmy points out, if there are no rows in the data table corresponding to a particular cell, then it can't return anything since there's nothing to evaluate. It doesn't matter if you add "+0" to the measure since it never gets called in the first place.

     

    The solution to this is to use dimension tables to populate the rows and columns in the visual. I.e., a date table for the rows and some sort of index table for the columns. This way, the measure you put in the matrix cells lives in the cross-join of the dimensions rather than being limited to the subset that intersects with your data table.


    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Thank you! With that I filled in what was missing but does not paint me in green the cases in 0, how could I do in this case?

      Mery98_0-1654474180353.png

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        In order to give you a suitable solution, could you please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

        How to upload PBI in Community

        Best Regards