Matrix Content Misalignment in Power BI Workspace upon Publishing
Anonymous
Here is a detailed explanation of the steps to recreate using the Power BI sample dataset:
- Load in the sample data set into Power BI desktop
- Set dimensions of the page to custom 720px by 1500 px
- Add a slicer to Page 1 with Sheet1[Product]
- Change slicer setting to dropdown and single select
- Add a slicer to Page 1 with Sheet1[Product]
- Change slicer setting to dropdown and single select
- Add a slicer to Page 1 with Sheet1[Year]
- Change slicer setting to dropdown
- Create a Matrix with the following fields from the Sheet1 source:
- Columns: Sheet1[Year] and Sheet1[Month Name]
- Sort Sheet1[Month Name] by Sheet1[Month Number]
- Values: Create the following measures and add them to the Values Section of the Matrix
- Sum of Units Sold = SUM(Sheet1[Units Sold])
- Average Unit Sale Price = SUM(Sheet1[ Sales])/SUM(Sheet1[Units Sold])
- Average Unit Cost = SUM(Sheet1[COGS])/SUM(Sheet1[Units Sold])
- Blank = “xxxxxxxxxxxx”
- Total Sales = SUM(Sheet1[ Sales])
- Total COGS = SUM(Sheet1[COGS])
- Blank = “xxxxxxxxxxxx”
- Total Profit = SUM(Sheet1[Profit])
*I add the “Blank” measures to the matrix to add spacing between sections
- Format Matrix
- Under "Values" turn on "Switch values to rows"
- Under “Values”, set the Alternate Background Color to white
- Under Specific Column,
- Select “Blank” series and set the text color and background to white
- Apply to header, subtotals, total, and values
- Select “Total Profit” series and set the background color to light grey
- Apply to header, subtotals, total, and values
- Select “Blank” series and set the text color and background to white
- Columns: Sheet1[Year] and Sheet1[Month Name]
- Add a text box to the top of the page with text “Total Sales” as a page title
- Add a rounded rectangle shape to the page
- Change the Rounded Corners to 10%
- Change the background color to light grey
- Change the border color to dark grey
- Turn on Text and type “Units”. Change the text to font 12 with font color black.
- Move and resize to be next to the “Sum of Units Sold”, “Average Unit Sale Price”, and “Average Unit Cost” lines of the Matrix
- Add a rounded rectangle shape to the page
- Change the Rounded Corners to 10%
- Change the background color to light grey
- Change the border color to dark grey
- Turn on Text and type “Total $”. Change the text to font 12 with font color black.
- Move and resize to be next to the “Total Sales” and “Total COGS” rows of the Matrix
- Upload to Power BI Server
Here is a screenshot of the page in Power BI Desktop:
Here is a screenshot of the page in the server:
Notice 2 things:
1. Although the dimensions of the visual have not changed, the font inside the matrix seems to have expanded and now requires a scroll bar.
2. The dimensions of both the matrix and the rectangle shapes have not changed, but the shapes do not line up the rows like they did in the desktop view.
*Similar to what bruno_araujo mentioned in an earlier post in this thread, I have noticed that at some font sizes, the matrix tends to expand. At other font sizes, the matrix tends to retract. But, both of these situations affect the alignment of the visuals on the page and have a similar effect on the user experience.
Additionally, the effects of point 2 grow as you add more rows to the matrix. For the sake of explanation, I have duplicated each measure in the matrix to show the effects on a larger matrix with more value rows.
In Power BI desktop:
In Power BI Server: