Forum Discussion

KR300's avatar
KR300
Icon for Helper III rankHelper III
1 year ago
Solved

Dynamic Fill Color based on Multiple AND Conditions

Hi I have a table like below.   I have a shape visual for each stage. I want to fill up color dynamically in the shape visual based on certain conditions. Moreover, i have only one slicer in the re...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Hi, KR300 
    Thanks for reaching out to the Microsoft fabric community forum.

    Regarding the issue you raised, my solution is as follows:

    1.Firstly, I referenced your data:

    2.Secondly, I created the following measures:

    color = 
    VAR aa =
        SUMMARIZE (
            'Table',
            'Table'[Is Final Round],
            'Table'[Stage],
            'Table'[Stage Status],
            "color",
                IF (
                    'Table'[Is Final Round] = TRUE ()
                        && [Stage Status] = "Success",
                    "Green",
                    IF (
                        'Table'[Is Final Round] = TRUE ()
                            && [Stage Status] = "Unsuccess",
                        "Red",
                        IF (
                            'Table'[Is Final Round] = TRUE ()
                                && [Stage Status] = "In Progress",
                            "Yellow",
                            BLANK ()
                        )
                    )
                )
        )
    VAR bb =
        MAXX ( FILTER ( aa, 'Table'[Stage] = MAX ( 'Table'[Stage] ) ), [color] )
    RETURN
        IF ( ISBLANK ( bb ), "white", bb )
    

    3.Then, I modified the visual settings as follows:

     

    4.Here's my final result, which I hope meets your requirements.

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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