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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
paydarneda
Regular Visitor

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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