Forum Discussion
Reordering Column Headers in Matrix with Field Parameters and Calculation Groups
Hello guys,
I created 2 separate measure field parameters (FP) for selecting categories of measures:
- FP1: total sales, total quantity, etc.
- FP2: total cost, training cost, etc.
I also created 2 calculation groups for time intelligence:
- CG1: current period, previous period, same period last year (SPLY) for time comparison
- CG2: month to date, year to date for time-based metrics
I added all 4 of them as separate slicers for my matrix. What I need is that when I select any field from 4 slicers, they should reflect in the matrix. For example, when I select total sales from FP1, total cost from FP2, current period and SPLY from CG1, and both items from CG2, my matrix will show like this:
Matrix with CG and FP
This matrix is good. However, I want to change the position of the column header. Currently, the column header appears as a hierarchy, with the measures at the lowest level and the 2 calculation groups above them.
Is there any way to show the measure at the first level, or the second level, or change it ourselves? Something like this:
Column Header 1
or
Column Header 2
Another way I tried:
Instead of creating calculation groups, I created all detailed measures such as Total sales MTD, Total cost MTD, Total sales YTD, Total cost YTD, Total sales MTD SPLY, Total cost MTD SPLY, etc. Then I created a table All KPIs to list all detailed measure names and some corresponding columns needed:
All KPIs table
and a measure using SWITCH also is created:
Header Measure =
VAR MeasureName = SELECTEDVALUE('All KPIs'[Measure name])
RETURN
SWITCH(
TRUE(),
MeasureName = "Total Sales MTD", [Total Sales MTD],
MeasureName = "Total Sales MTD SPLY", [Total Sales MTD SPLY],
MeasureName = "Total Sales YTD", [Total Sales YTD],
MeasureName = "Total Sales YTD SPLY", [Total Sales YTD SPLY],
MeasureName = "Total Cost MTD", [Total Cost MTD],
MeasureName = "Total Cost MTD SPLY", [Total Cost MTD SPLY],
MeasureName = "Total Cost YTD", [Total Cost YTD],
MeasureName = "Total Cost YTD SPLY", [Total Cost YTD SPLY]
...
)
I added this measure, Measure group, Time comparison, and Time-based to the matrix, and now the matrix looks fine with the reordered column header levels
Matrix
However, the problem I face with this approach is that I cannot use two slicers for separate 'Measure group'. I can only use one slicer for the Measure Group to filter the measures that appear in the matrix. This does not meet my requirement of having two slicers for groups of measures and two slicers for time-based and time comparison.
So, is there any way to meet my requirements? I have tried both approaches but haven’t found a solution.
Appreciate your guidance. Thank you!
Hi SamVH12
Althought the visibility is controlled by a field parameter, field parameters are essential just field selectors - they are not actual columns. Measures in matrix are currently always at the bottom of the hiearchy. A workaround is to materialize the results of these measures in a disconnected table containing the measure names using another measure and add that column together with the measure to the matrix visual.
Please see the attached pbix.
- Anonymous5 months ago
Hi SamVH12
Thank you for reaching out to the Microsoft Fabric Forum Community.
Thanks for the inputs danextian collinq
Inputs from users are very valuable, and additionally, based on my understanding, Power BI doesn’t fully support all of these requirements working together. If you keep both field parameters and calculation groups, everything stays flexible, users can pick measures and time options independently but the downside is that you can’t rearrange the column hierarchy. Measures will always show up at the lowest level in the matrix. If you switch to a disconnected table approach, you do get control over how the columns are displayed, which is nice. But then you lose the ability to have separate slicers for different measure groups, since everything gets combined into one selection. So it really comes down to a trade-off: you can either keep the flexibility with multiple slicers, or control the column layout but unfortunately, not both at the same time.
If there are any deviations from your expectation please let us know we are happy to address.
Thanks.
8 Replies
- AnonymousNot applicable
Hi SamVH12
Thank you for reaching out to the Microsoft Fabric Forum Community.
Thanks for the inputs danextian collinq
Inputs from users are very valuable, and additionally, based on my understanding, Power BI doesn’t fully support all of these requirements working together. If you keep both field parameters and calculation groups, everything stays flexible, users can pick measures and time options independently but the downside is that you can’t rearrange the column hierarchy. Measures will always show up at the lowest level in the matrix. If you switch to a disconnected table approach, you do get control over how the columns are displayed, which is nice. But then you lose the ability to have separate slicers for different measure groups, since everything gets combined into one selection. So it really comes down to a trade-off: you can either keep the flexibility with multiple slicers, or control the column layout but unfortunately, not both at the same time.
If there are any deviations from your expectation please let us know we are happy to address.
Thanks.
- AnonymousNot applicable
Hi SamVH12
Thank you for reaching out to the Microsoft Fabric Forum Community.
I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.
- AnonymousNot applicable
Hi SamVH12
Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.
- collinq
Super User
HI SamVH12 ,
I do not think that you can do your request with calculation groups and field parameters. Column hierarcy order is controlled by Power BI. So, the order cannot be chagned.
However, I looked it up and found this answer:
Keep calculation groups, but move slicer logic into display structure
Key ideaDo not fight the Matrix header order
Instead control what users pick before it reaches the MatrixHow it works
Keep:
FP1, FP2
CG1, CG2
But:Disable column hierarchy
Show measures only at the lowest displayed level
Add custom column headers via dynamic titles or tooltip labels🔹 Users still slice independently
🔹 Matrix still evaluates properly
🔹 Headers look cleaner, even if technically hierarchical
This is the most maintainable approach in large models. - danextian
Super User
Hi SamVH12
Althought the visibility is controlled by a field parameter, field parameters are essential just field selectors - they are not actual columns. Measures in matrix are currently always at the bottom of the hiearchy. A workaround is to materialize the results of these measures in a disconnected table containing the measure names using another measure and add that column together with the measure to the matrix visual.
Please see the attached pbix.
- SamVH12
Helper I
Hi danextian
Thank you for your response. I would like to ask how the disconnected table connects to the field parameter or the calculation group. I need to use two field parameters and two calculation groups because I have many measures and comparisons across different periods (current period, previous period, MTD, YTD, etc.), and users can choose which measures and which periods they want to add to the table, not just two or three fixed ones. Your suggestion is similar to the second approach I tried, but that only allows one field parameter (and I didn’t use a calculation group in that approach), while I need two parameters to separate categories of measures. Is there a possible workaround for this?