Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi,
I have a matrix in Power BI with two measures: MEASURE A and MEASURE B, shown under each month. I want MEASURE B to appear only in the total row, not in the individual rows.
I don’t want to hide the column or reduce its width, since new months will keep adding it back.
Is there a way to do this dynamically?
Thanks!
Solved! Go to Solution.
Hi @AP1081 ,
Sorry for the late response but I missed your questions on the notifications.
You can try the following:
I used this calculated table:
Category =
UNION (
SUMMARIZE (
'Fact_Table',
'Fact_Table'[Year],
'Fact_Table'[Month],
"Measure", "Measure A"
),
ROW ( "Year", "Total", "Month", "Total", "Measure", "Measure B" ),
ROW ( "Year", "Total", "Month", "Total", "Measure", "Measure C" )
)
Final result:
Be aware that my model is not a complex one but you can use the values in the calendar table for years and month if you have it.
Now create the following measures:
Calculation = VAR _Year = FILTER(
SELECTCOLUMNS(
FILTER(
Category,
Category[Year] <> "Total"
),
"Year", VALUE(Category[Year])
),
[Year] IN VALUES('Fact_Table'[Year])
)
VAR _Month = FILTER(
SELECTCOLUMNS(
FILTER(
Category,
Category[Year] <> "Total"
),
"Month", VALUE(Category[Month])
),
[Month] IN VALUES('Fact_Table'[Month])
)
VAR _measureA = CALCULATE(
[Measure A],
'Fact_Table'[Year] IN _Year,
'Fact_Table'[Month] IN _Month
)
RETURN
SWITCH(
SELECTEDVALUE(Category[Measure]),
"Measure A", _measureA,
"Measure B", [Measure B],
"Measure C", [Measure C]
)
Format = SWITCH(
TRUE(),
SELECTEDVALUE(Category[Measure]) = "Measure B" && [Calculation] < 15, "Red",
SELECTEDVALUE(Category[Measure]) = "Measure B" && [Calculation] < 20, "Yellow",
SELECTEDVALUE(Category[Measure]) = "Measure B" && [Calculation] >= 20, "Green"
)
The first measure makes the calculation based on the level of the hierarchy you are, in the first variables Year and Month I did the filter in order for your matrix to also be responsive to any date filter you may have.
Now you just need to setup the matrix:
If you want you can include several other values on the formatting or on the calculation just by changing the switch statment.
Please see file attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt's a good idea but I'm afraid you cannot conditionally remove column headers or entire measure columns using field parameters, you will still have column headers with blank values.
Yes in that case using a calculation table and to populate the matrix use a measure with selected value with input from the new calculation table for values. Sorry i couldn't do the DAX since it's celebrations here in India and I'm away from my laptop:) hope that helps.
If I understand correctly, you're talking about adding a calculation table and a measure using SELECTEDVALUE to pick the right measure based on context.
However, in that case, the table won’t show totals at all.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!