Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
AP1081
Frequent Visitor

Show Measure Only in Totals in Matrix

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!

image.png

1 ACCEPTED SOLUTION

Hi @AP1081 ,

 

Sorry for the late response but I missed your questions on the notifications.

 

You can try the following:

  • Create a table that merges the Year/Month and a category column with the measure name
  • For the measure you want to have in the Year month you must add a value for each of the combinations year month measure for the ones you want in the total you need to add only a row

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:

MFelix_0-1761207277271.png

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:

  • Columns:
    • Category[Year]
    • Category[Month]
    • Category[Measure]
  • Rows
    • FactTabler[Cat]
  • Values
    • [Calculation]
  • Condittional formatting
    • [Format]

MFelix_1-1761207633267.png

MFelix_2-1761207649443.png

 

 

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


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

23 REPLIES 23
AP1081
Frequent Visitor

It'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. 

AP1081
Frequent Visitor

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors