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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

How to compare two text column in a matrix

I have a matrix like below. That shows the manager name in different month. I need to compare the two text columns in the same row and if the name is different, then get color in second column or first column. 

paydarneda_0-1648243886056.png

 

I need a result like this: Get a color in a column that are not the same with the first one

paydarneda_1-1648244062979.png

 

Thanks in advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

 

tables i have used 

 

manager table

esha_shah2002_1-1648278900294.png

 

date table(just for this demo)

 

esha_shah2002_2-1648278926779.png

 

create a relationship between the month columns of 2 tables

Try the following steps:

 

1. Create a table with the following fields

esha_shah2002_3-1648279035216.png

 

2. use the following measure in conditional formatting(background color) of manager column of the table

COLOR =
IF (
CALCULATE (
DISTINCTCOUNT ( Manager[Manager] ),
ALLEXCEPT (
Manager,
Manager[Emp_id]
)
) > 1
&& CALCULATE (
MAX ( 'date'[MonthNumber] ),
ALL ( Manager )
)
= SELECTEDVALUE ( 'date'[MonthNumber] ),
"Green"
)

 

esha_shah2002_0-1648278844107.png

 

esha_shah2002_0-1648281167816.png

 

 

3. convert it to matrix

esha_shah2002_1-1648281180260.png

 

If this post helps, Accept it as a solution

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi

 

tables i have used 

 

manager table

esha_shah2002_1-1648278900294.png

 

date table(just for this demo)

 

esha_shah2002_2-1648278926779.png

 

create a relationship between the month columns of 2 tables

Try the following steps:

 

1. Create a table with the following fields

esha_shah2002_3-1648279035216.png

 

2. use the following measure in conditional formatting(background color) of manager column of the table

COLOR =
IF (
CALCULATE (
DISTINCTCOUNT ( Manager[Manager] ),
ALLEXCEPT (
Manager,
Manager[Emp_id]
)
) > 1
&& CALCULATE (
MAX ( 'date'[MonthNumber] ),
ALL ( Manager )
)
= SELECTEDVALUE ( 'date'[MonthNumber] ),
"Green"
)

 

esha_shah2002_0-1648278844107.png

 

esha_shah2002_0-1648281167816.png

 

 

3. convert it to matrix

esha_shah2002_1-1648281180260.png

 

If this post helps, Accept it as a solution

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors