Forum Discussion

Aqua1's avatar
Aqua1
Frequent Visitor
1 year ago
Solved

Formatting specific row headers/row info

Apologies if this has been covered before.  I am pulling together a very basic income statement.  It's not dynamic and the data is pulled from excel.  What id like to do is grey out revenue and gross...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Aqua1  ,
    Thank you burakkaragoz  and pankajnamekar25  for your reply regrading the Issue.

    Thank you  for reaching out to the Microsoft fabric community forum.

    Power BI does not allow conditional formatting directly on row headers in a Matrix. But there’s a simple workaround: if you have a "Line Item" column with values like "Revenue" and "Gross Profit", you can use it in the Rows field of the Matrix.
    Then create a DAX measure like RowColor to return a specific color for those items

    RowColor = 
    SWITCH(
        TRUE(),
        SELECTEDVALUE(IncomeStatement[Line Item]) = "Revenue", "#D3D3D3",  
        SELECTEDVALUE(IncomeStatement[Line Item]) = "Gross Profit", "#D3D3D3",
        BLANK()  
    )
    


    After adding the Matrix go to the Format pane > Cell elements > turn on Font color or Background color > click the “fx” button > choose “Format by: Field value” and select your RowColor measure.

    This will apply the formatting only to those rows and help highlight them as needed. Please find the attached pbix file and screenshot for your reference:

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  
    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

    Best Regards,
    Harshitha.
    Community Support Team