cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
skowronp Frequent Visitor
Frequent Visitor

Filtering row header and column header for matrix visual

Hi All,

 

I have a problem with context filtering. I have to calculate measure (direct query mode) for the matrix visual purposes. What I want to achieve is to dynamically compare row and column headers (from different dimensions) and if they are equal put 0. Any ideas ?

 

CALCULATE(something; FILTER(DimensionA[columnA];CONTAINS(DimensionA;DimensionA[columnA];DimensionB[columnB])=true());

 

As result I want to have something like this:
       A     B     C     D
A     0    1     1     1
B     1     0     1     1
C     1     1     0     1
D     1     1     1     0

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-sihou-msft
Moderator

Re: Filtering row header and column header for matrix visual

@skowronp

 

This measure is sliced by both DimensionA[columnA] and DimensionB[columnB]. It will not detect if current slicing member has same name.

 

Is there relationship between DimensionA[columnA] and DimensionB[columnB]? If not, you must have a table with both colums cross join. 

 

24.PNG

 

Then create a measure like below: 

 

 = IF(MAX('Table'[ColumnA])=MAX('Table'[ColumnB]),0,1)

66.PNG

 

Regards,

 

 

View solution in original post

1 REPLY 1
Moderator v-sihou-msft
Moderator

Re: Filtering row header and column header for matrix visual

@skowronp

 

This measure is sliced by both DimensionA[columnA] and DimensionB[columnB]. It will not detect if current slicing member has same name.

 

Is there relationship between DimensionA[columnA] and DimensionB[columnB]? If not, you must have a table with both colums cross join. 

 

24.PNG

 

Then create a measure like below: 

 

 = IF(MAX('Table'[ColumnA])=MAX('Table'[ColumnB]),0,1)

66.PNG

 

Regards,

 

 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 508 members 4,582 guests
Please welcome our newest community members: