Forum Discussion

govind_021's avatar
govind_021
Super User
1 year ago
Solved

Conditional Formatting

Hello Everyone , 
I am having one issue , can anyone please help

Scenerio is that
I have Matrix visual and on rows I have two columns employee and project , and in columns i have year and month employee upper in hierarchy and projects will show when we will drill down . I have one KPI that i am using in values so kpi is percent , so at employee level conditional formatting have been applied on the basis of magnitude of the percent value , so i have three color red , green , yellow  and when i drill down to project level I want formatting different , the percent should show as it is but not basis of the magnitude , but on the basis of category column ( ordered = grey , planned = blue , blank = white ) . 
so how can i solve this.
ask if you require any other info.

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi govind_021 

     

    Thank you very much Ritaf1983 for your prompt reply.

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    "Table"

     

    Create a measure. Different colors are displayed by judging the current hierarchical structure of the matrix.

     

    ProjectColor = 
    IF(
        ISINSCOPE('Table'[Project]),
        SWITCH(
            TRUE(),
            ISBLANK(SELECTEDVALUE('Table'[Category])), "White",
            SELECTEDVALUE('Table'[Category]) = "Ordered", "Grey",
            SELECTEDVALUE('Table'[Category]) = "Planned", "Blue"
        ),
        IF(
            ISINSCOPE('Table'[Employee]),
            SWITCH(
                TRUE(),
                SELECTEDVALUE('Table'[KPI]) < 0.60, "Red",
                SELECTEDVALUE('Table'[KPI]) = 0.60, "Yellow",
                SELECTEDVALUE('Table'[KPI]) > 0.60, "Green"
            )
        )
    )

     

     

     

    Here is the result.

     

    Employee level

     

    Project level

     

    Regards,

    Nono Chen

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi govind_021 

     

    Thank you very much Ritaf1983 for your prompt reply.

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    "Table"

     

    Create a measure. Different colors are displayed by judging the current hierarchical structure of the matrix.

     

    ProjectColor = 
    IF(
        ISINSCOPE('Table'[Project]),
        SWITCH(
            TRUE(),
            ISBLANK(SELECTEDVALUE('Table'[Category])), "White",
            SELECTEDVALUE('Table'[Category]) = "Ordered", "Grey",
            SELECTEDVALUE('Table'[Category]) = "Planned", "Blue"
        ),
        IF(
            ISINSCOPE('Table'[Employee]),
            SWITCH(
                TRUE(),
                SELECTEDVALUE('Table'[KPI]) < 0.60, "Red",
                SELECTEDVALUE('Table'[KPI]) = 0.60, "Yellow",
                SELECTEDVALUE('Table'[KPI]) > 0.60, "Green"
            )
        )
    )

     

     

     

    Here is the result.

     

    Employee level

     

    Project level

     

    Regards,

    Nono Chen

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

  • Hi govind_021 

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...