Forum Discussion

Netope's avatar
Netope
Helper I
2 years ago
Solved

Heatmap on Matrix using column and row values

Dear community:   Is there a way to use column and row values to color a matrix as a heatmap:   This is what I have: And this is what I would like to get: In this example, for color...
  • PijushRoy's avatar
    2 years ago

    Yes Netope 

    You can do, please create measure and apply as Background color conditional formatting
    Step - Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

    If you want to specific answer, please create a sample pbix and share the link (google drive, dropbox, onedrive)
    Please share accurate logic for all color



    Let me know if that works for you


    If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

    Thanks
    Pijush
    Linkedin

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Netope 

    As PijushRoy  mentioned, you can use conditionfal formatting.

    You can refer to the following sample.

    2.I create a matrix and put the following fields to the matrix.

     

    3.Create a measure to set the condition of the color.

    MEASURE =
    VAR a =
        SELECTEDVALUE ( 'Table'[BP Number] )
    VAR b =
        SELECTEDVALUE ( 'Table'[Number] )
    RETURN
        SWITCH (
            TRUE (),
            a = 0
                && b = 0, "grey",
            a = 1
                && b <= 1
                || a < 1
                && b = 1, "red",
            a = 2
                && b <= 2
                || a < 2
                && b = 2, "yellow",
            a = 3
                && b <= 3
                || a < 3
                && b = 3, "green"
        )
    

    Then put the measure to the conditional formatting of the value field.

     

     

    Output

    Best Regards!

    Yolo Zhu

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