Forum Discussion

pasit's avatar
pasit
Frequent Visitor
3 years ago

undefined

Hi,
 
I'm working with Power BI report and I have problem to remove blank rows from matrix .. I have product hierarchy that is inconsistent. 
 
Hierarchy goes for example so that
 
- Main product
          - Component
          - Sub product 1
                    - Component 3
          - Sub product 2
                    - Component 1
                              - Sub component 1
                                        - Sub component 6
                   - Component 2
 
And so on .. there can be 7 level in hierarchy
In the matrix are 10 different measures, like sales, last year sales, coming sales, gross margin ... 
 
I'm not able to provide sample data more closely, but is there any easy way to hide blank rows from the matrix because although measures does not return any calculated data hierarchy is always shown to the lowest level .. and if I try to filter data from some empty hierarchy level, it removes all rows from the matrix that level even there would be some data ... this is very confusing. The requirement is to use matrix, but is there any other way to show this kind of hierarchcal data .. treemap is not good choise
 
Pasi

1 Reply

  • Hello pasit,

     

    1. Create a new calculated measure that checks if any of the measures at the lowest level of your hierarchy has a value.

     

    ShowRow = IF(ISBLANK([Sales]), BLANK(), 1)

     

    2. Add the new calculated measure to your matrix alongside your other measures.

    3. Select the matrix visual, go to the "Format" pane, and navigate to the "Conditional formatting" section. Choose "Background color" under "Font color" and select the "Field value" option. In the "Based on field" dropdown, choose the calculated measure you created in step 1 (ShowRow). Set the formatting options for the blank rows, such as setting the font color to match the background color or choosing a different background color to make the row appear hidden.

     

    Should you need further assistance please don't hesitate to reach out to me.