cancel
Showing results for
Did you mean:
Frequent Visitor

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

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

Then create a measure like below:

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

Regards,

Moderator

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

Then create a measure like below:

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

Regards,

Announcements

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors