Forum Discussion

Dunner2020's avatar
Dunner2020
Post Prodigy
5 years ago
Solved

Representing measure in table

Hi there,   Here is a picture that I want to create in power BI:   Now I got a table, which already contains column that has value H1,H2,.....H5 and a column that contains C1,C2,C3,C4. In t...
  • Icey's avatar
    Icey
    5 years ago

    Hi Dunner2020 ,

     

    For color formatting, you can try to create a measure and use it in conditional formatting like so:

     

    Conditional formatting Measure =
    VAR H_ =
        SELECTEDVALUE ( 'sde support_structure_evw'[AHI Score] )
    VAR C_ =
        SELECTEDVALUE ( 'sde support_structure_evw'[Criticality zone] )
    RETURN
        SWITCH (
            TRUE (),
            H_ = "H1"
                && C_ = "C1", "light blue",
            H_ = "H2"
                && C_ IN { "C1", "C2" }, "deepskyblue",
            H_ = "H3"
                && C_ IN { "C1", "C2", "C3" }, "dodgerblue",
            H_ = "H4"
                && C_ IN { "C1", "C2", "C3", "C4" }, "blue",
            "green"
        )
    

     

    Reference: Conditional table formatting in Power BI Desktop - Power BI | Microsoft Docs

     

     

     

    Best Regards,

    Icey

     

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