Forum Discussion

khookayhu's avatar
khookayhu
Frequent Visitor
2 years ago
Solved

Highlight cells with different values within the same row and respond to slicer

Hi,

 

I would like to highlight rows that contains different values across columns in a matrix table.  The data originates from multiple files that contains similar content with values (text and numbers)

 

Example of file

File01

Parameter Value

Para01 1

Para02 X

Para03 12

 

File02

Parameter Value

Para01 2

Para02 Z

Para03 12

 

File03

Parameter Value

Para01 2

Para02 X

Para03 13

 

Example of matrix

Matrix Table

Parameter File01 File02 File03

Para01 1 2 2

Para02 X Z X

Para03 12 12 13

 

Slicer [Filename}

 

I would like to highlight the whole row when distinct values within row >1.  Example, when slicer [Filename} is used (File01 and File03 selected), Para01 and Para03 is highlighted.

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi khookayhu ,
    Consider adding a column of tags for each file and appending it to a new table.

    then create a new measure:

    Measure = 
    VAR _count = CALCULATE(DISTINCTCOUNT('Files'[Value]),ALLSELECTED('Files'[Filename]))
    VAR _color = IF(_count>1,"Red")
    RETURN
    _color

    And use it as the conditional formatting:


    Please check the pbix file.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

3 Replies

  • khookayhu's avatar
    khookayhu
    Frequent Visitor

    I found a possible solution Here but it is hardcoded to a certain column name.  I would like to add a slicer for the column name which means, the first column name might change depends on the user selection.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi khookayhu ,
      Consider adding a column of tags for each file and appending it to a new table.

      then create a new measure:

      Measure = 
      VAR _count = CALCULATE(DISTINCTCOUNT('Files'[Value]),ALLSELECTED('Files'[Filename]))
      VAR _color = IF(_count>1,"Red")
      RETURN
      _color

      And use it as the conditional formatting:


      Please check the pbix file.

      Best Regards,
      Gao

      Community Support Team

       

      If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
      If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

      How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

      • khookayhu's avatar
        khookayhu
        Frequent Visitor

        Hi,

         

        This worked perfectly.  I had another column for Tool Name.  Fixed by adding ALLSELECTED('Files[Tool Name]) as below.  Thank you so much.

         

        Measure =
        VAR _count = CALCULATE(DISTINCTCOUNT('Files'[Value]),ALLSELECTED('Files'[Filename]),ALLSELECTED('Files[Tool Name]))
        VAR _color = IF(_count>1,"Red")
        RETURN
        _color