Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
djoellet
Frequent Visitor

Conditional formatting in a matrix for whitespace analysis

If we are selling a certain product, we may be unable to offer another product/service line.  I would like to format fields in a matrix based on text in other fields; please see the image below.  This was built using a product column and a client column, the X represents products the clients have purchased.  I want the product fields that we cannot offer to be grey. Is it possible to recreate this in PBI?

 

djoellet_4-1702818642934.png

 

Thank you

1 REPLY 1
danextian
Super User
Super User

Hi @djoellet ,

 

Based on the information provided, your conditional formatting measure would go something like this:

conditional formatting =
VAR __PROD =
    SELECTEDVALUE ( data[product] )
VAR __PROD_A =
    CALCULATE ( [my measure], data[product] = "A" )
VAR __PROD_B =
    CALCULATE ( [my measure], data[product] = "B" )
VAR __PROD_C =
    CALCULATE ( [my measure], data[product] = "C" )
RETURN
    IF (
        (
            NOT ( ISBLANK ( __PROD_A ) )
                && __PROD IN { "B", "D" }
        )
            || (
                NOT ( ISBLANK ( __PROD_B ) )
                    && __PROD = "D"
            )
            || (
                NOT ( ISBLANK ( __PROD_C ) )
                    && __PROD IN { "D", "E" }
            ),
        "gray"
    )

 

Replace [my measure] witht the actual measure you use for X and gray with another color or hexadecimal code. Gray's hex is #808080 but it may vary depending on the hue you want.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.