Forum Discussion

JB505's avatar
JB505
Frequent Visitor
3 years ago

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"

 

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

Here is my measure.

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

2 Replies

  • 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. 

     

     

    • JB505's avatar
      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

      Expanded

       

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