Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DISPLAY RED IF STATUS NOT AVAILABLE

Hi,

 

I have a problem here.. 

 

I want to display some IDs RED based on status "not available" in a table.

The problem is that I have a column in my fact table where the data will decide if the machine is:

5 = available,

8 = busy or 

10= not available. 

If the IDs (which are in the fact table) are also in an another table named "not available" then the IDs will be displayed not available EXCEPT the values that are 5 = available.

Only values from fact table 

8 = busy or 

10= not available. 

should be displayed red. 

 

Please help.

  • Anonymous's avatar
    Anonymous
    7 years ago

    Anonymous,

    Change the DAX of chkcol to the following, then configure conditional formatting as  below.

    chkcol = IF('Fact'[StatusFromanothertable]<>""&&'Fact'[Value]=8,1,IF('Fact'[StatusFromanothertable]=""&&'Fact'[Value]=8,2,0))




    Regards,
    Lydia

  • Anonymous's avatar
    Anonymous
    7 years ago

    Anonymous,

    I have sent your PBIX file via Private Message.

    Regards,
    Lydia

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous,


    I make a test in the following tables.


    Firstly, create the following columns in fact table.

    Column = LOOKUPVALUE('not available'[Satus],'not available'[IDs],'Fact'[IDs])
    checkcol = IF(NOT(ISBLANK('Fact'[Column]))&&'Fact'[IDs]<>5,1,0)


    Secondly, create a table visual and then configure conditional formatting  as below.


    If the above DAX don't help, please share sample data of your tables here.



    Regards,
    Lydia

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous

      Thank you so much!! We're almost there..

       

      I have created a dataset:

      • Here is my "Not Available" dim table. You'll see that we have a column with IDs from "Fact" table that says: if some of these values from Not Available table are in the Fact table, then it should be displayed RED if the value is 8 in the Fact[Value] column 

       

      • Here you also have my Fact table. I've created some columns to show how I want the color formatting.
        One of the big challenges is that, the IDs from Not Available table can also be displayed green and orange if the value in the Fact[Value] is 5 or 4 
        BUT if the IDs from Not Availbale table are in the Fact table and the value is 8 in Fact[Value], then it should only be displayed RED.

      In this table you can see that we have values ID's from 1 to 4. These are also in the Not Available table,

      Then the color formatting should be like this

      ID 1 = availbale = green

      ID 2 = availbale = green

      ID 3 = availbale = green

      ID 5 = not availbale = red.

       

       

      After we have done that, we also need to have color formatting for the IDs in the Fact table too that are not in the Not Available table based on the Fact table (the three column to the right)

       

      A lot of text, but I really need your help.

      Thank you very very much Lydia!!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous,

        Could you please share sample data of the two tables in Excel file so that I can copy and paste? Also what is the relationship in the two tables? Do you create relationship using ID field?

        Please follow the guide in this post to share sample data and share expected result.

        Regards,
        Lydia