Forum Discussion
Assistance Required - Power BI Visual Matrix
- 1 year ago
Hi Tejas
Ok, great to hear that there is some progress. I took another look to see if I could get rid of the empty columns . I could only find a solution in Power Query and this was the result :
In general the steps taken are as follows : Identifies the Maxmonth and two months before ( Query : MaxMonthQuery ) , which joins with the Grouped average per assignment group ( Query : GroupedAverageQuery ) . This then finally joins with the MaindataQuery ( filtered to show only 3 months prior to max date of the data ) to merge the average SLA% per group.
For the updated file see the same folder I placed the other Power BI files in.
Hope this helps
Antonio
To solve this challenge in Power BI Matrix where:
- Rows: Assignment Group
- Columns: Year-Month (e.g., "2025-04", "2025-05")
- Values: SLA %
- Extra Column: SLA% 3M (should show as a separate column, not repeat under each month)
We need to display a static column (SLA% 3M) in the matrix, unaffected by the column grouping (Month-Year), which Power BI matrix doesn’t directly support by default. However, here's how we can solve it with a workaround.
Solution:
- Create a New Table for Matrix Columns
We’ll use a disconnected table to define the columns we want in the matrix.
"Matrix Columns =
DATATABLE("ColumnLabel", STRING, {
{"Monthly SLA%"},
{"SLA% 3M"}
})
" - Create a Measure to Return SLA Values Conditionally
Now write a measure that handles both monthly SLA and the 3-month SLA logic:
"SLA % Matrix Display =
SWITCH(
SELECTEDVALUE('Matrix Columns'[ColumnLabel]),
"Monthly SLA%",
CALCULATE(
[SLA %],
REMOVEFILTERS('Matrix Columns')
),
"SLA% 3M",
CALCULATE(
[SLA % 3M],
REMOVEFILTERS('Date'), // or 'Calendar'[YearMonth], depending on your model
REMOVEFILTERS('Matrix Columns')
)
)
" - Create the Matrix Visual
Use the following fields:
- Rows: Assignment Group
- Columns: Matrix Columns[ColumnLabel]
- Values: SLA % Matrix Display
The problem arises because you're trying to show a measure independent of the column slicer, but the Power BI matrix groups values based on the column hierarchy.
By creating a custom column header table, and conditionally calculating measures using SELECTEDVALUE, you bypass this behavior and control what appears under each column.
If [SLA % 3M] isn't defined yet, here’s an example of how you can write one:
"SLA % 3M =
CALCULATE(
AVERAGE('YourTable'[SLA %]),
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH)
)
"
Modify logic based on your business rules.
If this solution works for you, please consider accepting it as the solution and giving it a kudos — it helps others find the answer more easily and supports the community.