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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.