Forum Discussion

ashmitp869's avatar
ashmitp869
Icon for Responsive Resident rankResponsive Resident
6 months ago
Solved

Conditional formating in Power BI Matrix similar like excel ?

Hi,

Can I do conditional formatting in Power BI Matrix similar to Excel?


 
Risk Level Colour = 
SWITCH (
    SELECTEDVALUE ( 'DimRisk'[Risk Level] ),
    "1 - Critical", "#C00000",   -- Red
    "2 - High",     "#ED7D31",   -- Amber
    "3 - Medium",   "#FFD966",   -- Yellow
    "4 - Low",      "#70AD47",   -- Green
    "5 - Entry",    "#A5A5A5",   -- Grey
    "#FFFFFF"
)

 



My PBI Matrix looks like below
And I have Risk level as Rows 

 

  • dikssha's avatar
    dikssha
    6 months ago

    Instead of Matrix visual, if you use Table visual then you can format rows easily. Go to cell elements and then select column one by one and apply the background color.

9 Replies

  •  

    • Go to Conditional formatting → Background color

    • Choose Format by: Field value

    • Select Risk Level Colour

     

  • Hi ashmitp869 

    It appears that you're trying to apply formatting to the row headers. Conditional formatting for matrix row and column headers is currently not supported. Your measure can be used as a field value for conditional formatting on the values section only.

      • dikssha's avatar
        dikssha
        Regular Visitor

        Instead of Matrix visual, if you use Table visual then you can format rows easily. Go to cell elements and then select column one by one and apply the background color.

  • Hi ashmitp869 

     

    Can you share sample data of tables in text format used in Matrix visual. Also, share the expected output/view you are looking for.

  • dikssha's avatar
    dikssha
    Regular Visitor

    Yes, Power BI allows conditional formatting. In the format pane go to 'Cell elements' and in that select the value column which you would like to format. Switch on the 'Background color' option. In the format style you can either use 'Rules' or 'Field value'.

    In 'Rules', select the column based on which you would like to create the conditions and then you can type it. For 'Field value', you just need to select the measure where you have written rules for conditional formatting.

  • dikssha's avatar
    dikssha
    Regular Visitor

    Yes, Power BI allows conditional formatting. In the format pane go to 'Cell elements' and in that select the value column which you would like to format. Switch on the 'Background color' option. In the format style you can either use 'Rules' or 'Field value'.

    In 'Rules', select the column based on which you would like to create the conditions and then you can type it. For 'Field value', you just need to select the measure where you have written rules for conditional formatting.

  • v-karpurapud's avatar
    v-karpurapud
    Icon for Community Support rankCommunity Support

    Hi ashmitp869 

    Thank you for submitting your question to the Microsoft Fabric Community Forum, and thanks to  cengizhanarslan , danextian and  dikssha for offering helpful suggestions.

     

    Could you let us know if the suggested solution resolved your issue? If it's still pending, please let us know any further details so we can help.


    Best regards,
    Community Support Team.

     

  • v-karpurapud's avatar
    v-karpurapud
    Icon for Community Support rankCommunity Support

    Hi ashmitp869 

    We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

     

    Thank You.