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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JB505
Frequent Visitor

Help with Matrix measure

Hello. I'm trying to accomplish something that seems very basic, but either can't figure it out or it's just not possible.

 

I have a measure that I want to show one thing when the matrix is collapsed, but show another thing on that same row when the matrix is expanded.

 

So when collapsed, I want Color to say "Expand Category"

JB505_0-1691006435955.png

 

When expanded, I want to show the color for the types of fruit, but I want the category (highlighted below) to be blank.

JB505_2-1691006628978.png

Here is my measure.

_color =
SWITCH(
    TRUE(),
    ISINSCOPE('Table'[Type]), MAX('Table'[Color]),
    ISINSCOPE('Table'[Category]), "Expand Category",
    BLANK()
)
 
Is this possible?
2 REPLIES 2
vicky_
Super User
Super User

There's a way to do this without DAX - go to format > Row Subtotals > select Category (i think?) and then uncheck the Show Subtotals. Have a play around to find a configuration that works for you. Hope this helps. 

 

vicky__0-1691014340653.png

 

JB505
Frequent Visitor

Hi @vicky_ ,

 

Appreciate the help. I don't think this can be solved with row subtotals. The reason is because I do want something to show up, just not all the time, if that makes sense. So here is what I want the visual to look like depending on when it's collapsed or expanded.

 

Collapsed

JB505_0-1691418812456.png

Expanded

JB505_1-1691419238597.png

 

See how the color column shows one thing in the fruit row depending on whether collapsed or expanded. It also shows the colors of the fruit. So it's three different things that the measure could show (Expand Category, Blank, Color of Fruit) and it all depends on the category being collapsed or expanded...

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.