Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Reference conditional formatting background color used in matrix in a filter measure

Hello,

 

I have a matrix where I've conditionally formatted one of the columns like this portion of the matrix:

 

Each of these columns is a measure.  FYTD and LFYTD are SUMs of invoices for the 2 FY's for a given customer. The Gain/Loss ($) column merely finds the difference between this FY and last FY.  The conditionally formatted Gain/Loss (%) column uses the DIVIDE function.  All values greater than zero are the same green color (RGB: (0,128,0)). 

 

What I want is to filter to display only the rows that have the solid green color.  Yes, I've tried filtering the Gain/Loss columns to only display rows with values > zero.  This is somehow changing the results in the 2 FY columns.  So, if it's possible, I'd like to just display the green background rows.

 

Is there a way to reference the green color as a filter condition in a measure?

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply Ashish_Mathur 

     

    Of course, I can't post my entire company confidential report, but I've anonymized the data in my linked attachment.  I trust it will be enough to understand my question.

    Anonymized Matrix 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Ashish_Mathur  I'm expecting to obtain what I said in my original post:

     

    "

     So, if it's possible, I'd like to just display the green background rows.

     

    Is there a way to reference the green color as a filter condition in a measure?

    "

    Which would look similar to this from the Anonymized Matrix if I could reference the green color in a DAX filter measure AND doing so wouldn't change the original values displayed above prior to filtering.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI Anonymous,

      Did this matrix conditional formatted base on measure expressions?
      If that is the case, you can write a new measure(logic: check original measure result and compare with selected items to return flag) and use it on the matrix 'visual level filter' to filter records.

      You can create a slicer using an unconnected table field as the source and write DAX expressions to extract the selection and compare it within the new formula.

      Applying a measure filter in Power BI - SQLBI

      If you are still confused about the coding formula, please share a pbix or some dummy data that keep raw data structure to test.

      How to Get Your Question Answered Quickly  

      Regards,

      Xiaoxin Sheng