If you’ve spent any length of time working with Power BI, you’ve more than likely had the requirement tossed at you to place pivoted columns and fixed columns side by side in a standard matrix visual. Just check the Power BI forums and you’ll see a number of posts trying to tackle this exact problem.
When I first received this requirement my advice to the users was “your ask will be a challenge as this is not standard Power BI functionality.” The response was “this should be easy for you though..” I was flattered, but that was not the case. I did figure it out thanks to some back-and-forth trial and error development with A.I. tools.
As a snarky aside, when users don’t understand the complexity of their asks, they aren’t as impressed when you solve the problem. At least they aren’t as impressed as I think they should be based upon the effort to solve said problem! Make them understand.
The result of my experimentation and toiling culminated in a hybrid matrix. The hybrid matrix places pivoted columns and fixed columns side by side in a single visual, with no custom visuals and no second table lined up beside it.
Because I love posterity (and sharing) I recorded a full walkthrough of the finished solution.
Watch the video so this blog post makes sense!!
Impress your manager and clients today by learning this trick!!
You’ll also receive other additional data analytics goodies related to some of my other videos.
Open Video in YouTube: Power BI Hybrid Matrix Trick: Custom Columns Next to Pivoted Columns
Native Power BI Matrix Functionality
In a native Power BI matrix using standard functionality, whenever you drop a field on the columns well, every measure is repeated under each of its values, your totals included. This is not the option the business asked you to provide.
Introducing the Hybrid Matrix
What I built is a “Hybrid Matrix” where columns that should pivot, do indeed pivot. The columns that we desire to stay put and untouched do exactly that.
My sample data example runs on fictional healthcare claims: 12,499 transactions across 5,722 claims, with dates of service from 2023 through 2025.
Rows break out by year and month of service. Fourteen payment-timing columns pivot like any matrix (paid the same month, one month later, two months later and so on), while three summary columns for collections, billings and a realization rate stay fixed on the right.

The finished hybrid matrix: fourteen timing columns pivot, while three summary columns stay fixed on the right.
The upside of the Hybrid Matrix solution is that the grid now reads like a comprehensible story. Each row shows how a month of claims got paid over time, and the summary columns tell you how much of the billed amount actually came back.
Across the whole sample the realization rate lands at 82.5%. The 2025 rows show the classic staircase: the more recent the month, the less time it has had to collect (November 2025 has barely left the starting gate).
This fictional claims data is just the worked example. The same pattern works with any field you want to pivot and any summary columns you want to keep fixed.
The Key Elements of the Approach

Three pieces that do the heavy lifting. The fourth, a measure table, is pure housekeeping.
Header Table: The Main Engine of the Solution
The first piece is a small table I type in by hand using DATATABLE [2]. It lists every heading the matrix will show, plus a sort number and a display format for each respective heading. It goes on the matrix’s Columns well. The table has no relationship to any other table; it is a disconnected table in the data model.
It supplies the labels, the order and the formats, while the measure decides what each heading actually means. Sorting the heading column by its sort number keeps everything in the right order instead of alphabetical chaos [3].
One Measure to Rule Them All
- Every cell in the matrix comes from a single SWITCH measure.
- SELECTEDVALUE reads the heading above the cell [4].
- ISINSCOPE confirms the matrix is grouping that cell by a heading [5].
- SWITCH sends the three summary headings to their own base measures.
- Any other heading is a timing bucket, so CALCULATE adds up the net payments whose bucket label matches the heading text.
HYBRID_MATRIX_MEASURE_COMPACT =VAR SelectedHeader = SELECTEDVALUE ( 'CUSTOM_MATRIX_HEADER'[COLUMNNAME] )RETURN IF ( ISINSCOPE ( 'CUSTOM_MATRIX_HEADER'[COLUMNNAME] ), SWITCH ( SelectedHeader, "Total Collections", [TotalCollections], "Total Billings", [TotalBillings], "Realization Rate", [CollectionsRate], CALCULATE ( SUM ( 'Transactions'[Net Payment] ), 'Transactions'[CUSTOM MONTH REFERENCE] = SelectedHeader ) ) )
Put this measure in the matrix’s Values well, with COLUMNNAME from the header table in the Columns well. Power BI calculates the measure once for every cell, and each time it checks which column header that cell sits under. If the header is one of the summary columns (Total Collections, Total Billings or Realization Rate), it returns that column’s measure.

Any other header is a payment timing bucket, so it adds up only the payments labelled with that bucket. That works because the header text matches the bucket labels exactly.
ISINSCOPE leaves the far-right grand total blank, since a total across mixed columns would be meaningless.
Format Dollars and Percents in One Dynamic Measure
One measure normally means one format, which is a problem when most columns are dollars and one is a percentage. A dynamic format string solves it [6]. The measure’s format expression looks up the display format for the heading above each cell, so the currency columns show whole dollars and the rate shows a percentage, all from the same measure.
//This returns a format code as text, not a number. SELECTEDVALUE
//reads the current column's FORMATSTRING from the header table.
//Year rows and the bottom Total row keep their column's format.
//Only the far-right column total, which has no single heading,
//falls back to currency.
SELECTEDVALUE ( 'CUSTOM_MATRIX_HEADER'[FORMATSTRING], "$#,0;($#,0);$#,0" )
Get the Files:
You’ll also receive other additional data analytics goodies related to some of my other videos!!
The guide walks through all eleven steps with checkpoints and an answer key, so you will know your numbers match to the dollar.
Get the step by step guide, sample data and interactive lineage diagrams (for comprehension) here:

As I said earlier and I’ll reiterate, “when users don’t understand the complexity of their asks, they aren’t as impressed when you solve the problem.”
If you have to use this technique to meet a requirement, make them understand so you get the recognition you deserve!!

Get out there and do some great things with your data!
References:
- Create a matrix visual in Power BI, Microsoft Learn
- DATATABLE, Microsoft Learn
- Sort one column by another column in Power BI, Microsoft Learn
- SELECTEDVALUE, Microsoft Learn
- ISINSCOPE, Microsoft Learn
- Create dynamic format strings for measures, Microsoft Learn
Sample data is fictional. Not affiliated with Microsoft.


