Forum Discussion

ladeko's avatar
ladeko
Regular Visitor
2 years ago

IF Statement between 2 TABLES and MULTIPLE Conditions

I have a Power BI dashbaord report that I use to do auditing employees. I would like specific columns inside the table to automatically highlight in yellow if certain conditions are met.  However, the 2 columns that I need to use are on 2 different tables. However, I have already created a relationship between the 2 tables.

 

If TABLE A, Column A = Vendor Error OR Business Associate Error , THEN Table B, Column B CANNOT Be BLANK. If they are blank I want each column that is blank highlighted in yellow

 

TABLE A NAME = Incidents

  • TABLE A, COLUMN A name = Primary Root Cause

TABLE B NAME = Investigations

  • TABLE B, COLUMN B name = Company Name

 

2ND PART (similar to above but table A, Column A only has one condition that must be met instead of 2)

 

If TABLE A, Column A = Human Error , THEN Table B, Column B, Column C, Column D, Column E and Column F CANNOT Be BLANK. If they are blank I want each column that is blank highlighted in yellow.

 

I appreciate any help I can get. Thank you soooooo much!! 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ladeko ,

     

    Based on the information you have provided, you can follow these steps:

    1.Add a measure.

     

    Measure =
    
    IF (
    
        (
    
            MAX ( Incidents[Primary Root Cause] ) = "Vendor Error"
    
                || MAX ( Incidents[Primary Root Cause] ) = "Business Associate Error"
    
        )
    
            && MAX ( Investigations[Column B] ) = BLANK (),
    
        "Yellow",
    
        IF (
    
            MAX ( Incidents[Primary Root Cause] ) = "Human Error"
    
                && MAX ( Investigations[Column B] ) = BLANK ()
    
                && MAX ( Investigations[Column C] ) = BLANK ()
    
                && MAX ( Investigations[Column D] ) = BLANK ()
    
                && MAX ( Investigations[Column E] ) = BLANK ()
    
                && MAX ( Investigations[Column F] ) = BLANK (),
    
            "Yellow"
    
        )
    
    )

     

    2.put the measure in Background color-Column B, C, D, E, F.

     

     

    Final output :

     

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Yifan Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.