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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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]) )

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@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]) )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.