Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

switch value depends on rows in matrix

Hi, Here the sample data, I created a matrix that drag the column1, dim1, dim2 to rows, and measure to values,

I want the row subtotal not display total of each category, rather show the column1 level return the max value of value1, and each element of dim1 display value2, and if expand to dim2, show the value2, is there a soution to create such a measure?

 

columu1dim1dim2value1value2
AA1aaa76
AA1bbb73
AA2ccc54
AA3ddd82
AA3eee89

here is the expected result of matrix visual

   measure
A  8
 A1 7
  aaa6
  bbb3
 A2 5
  ccc4
 A3 8
  ddd2
  eee9
  • Anonymous , You can use isinscope in a new measure

     

    Switch( true(),

    isinscope(Table[dim2]), Sum(Table[Value2]) ,

    isinscope(Table[dim1]), Max(Table[Value1]) ,

    isinscope(Table[Col1]), Max(Table[Value1]) )

1 Reply

  • Anonymous , You can use isinscope in a new measure

     

    Switch( true(),

    isinscope(Table[dim2]), Sum(Table[Value2]) ,

    isinscope(Table[dim1]), Max(Table[Value1]) ,

    isinscope(Table[Col1]), Max(Table[Value1]) )