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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
patilpoonam21
Helper I
Helper I

Highlight mismatch Data in Power BI Matrix in multiple rows for the same Id

Hi,

I have below data in Power BI. I need to highlight the cells for which data is not matching for the same Id for each column.

Is there any way to compare rows for same Id?

patilpoonam21_2-1716934171165.png

 

 

Thanks,

Poonam

2 ACCEPTED SOLUTIONS
Irwan
Super User
Super User

Hello @patilpoonam21 

 

Please check if this can work for your needs.

Irwan_3-1716952889210.png

 

1. Create three measure because there are three column to be checked.

for example this is for C1 duplicate check and yellow-coloring :

C1 Color =
var _key = SELECTEDVALUE('Table'[Key])
var _C1 = SELECTEDVALUE('Table'[C1])
var _Value = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Key]=_key&&'Table'[C1]=_C1))
Return
IF(
    _Value=1,
    "#FFFF00", //yellow color code
    "")
 
_Value is for checking duplicate of Key column and C1 column while conditional if for coloring every non-duplicate value.
 
2. go to column field then select the arrow and choose conditional formating.
Irwan_1-1716952723979.png

 

3. in conditional formating, choose Field Value in format style then select the measure that made before.

Irwan_2-1716952820782.png

 

and do the same for C2 and C3.

 

Hope this will help you.

Thank you.

View solution in original post

Anonymous
Not applicable

Hi,@patilpoonam21. Hello,@Irwan,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
I am glad to help you.

According to your description, you want to mark values in a table in power bi that are grouped by Key and are not the same in each column.

 

If I understand you correctly, you can refer to my test below.
You can also achieve the goal by constructing the measure.

I have constructed the corresponding measure for each column.

M_C1 = 
CALCULATE(DISTINCTCOUNT('case02'[C1]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))
M_C2 = 
CALCULATE(DISTINCTCOUNT('case02'[C2]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))
M_C3 = 
CALCULATE(DISTINCTCOUNT('case02'[C3]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))

Subsequently set the background for the columns in visual (changing the background color based on the value of the constructed measure)

vjtianmsft_0-1716953913049.png

like this:

vjtianmsft_1-1716953928067.png

vjtianmsft_2-1716953936517.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
patilpoonam21
Helper I
Helper I

Both the solutions are working. Thank you so much @Irwan & @Anonymous 

 

 

Anonymous
Not applicable

Hi,@patilpoonam21. Hello,@Irwan,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
I am glad to help you.

According to your description, you want to mark values in a table in power bi that are grouped by Key and are not the same in each column.

 

If I understand you correctly, you can refer to my test below.
You can also achieve the goal by constructing the measure.

I have constructed the corresponding measure for each column.

M_C1 = 
CALCULATE(DISTINCTCOUNT('case02'[C1]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))
M_C2 = 
CALCULATE(DISTINCTCOUNT('case02'[C2]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))
M_C3 = 
CALCULATE(DISTINCTCOUNT('case02'[C3]),FILTER(ALL(case02),'case02'[Key]=MAX('case02'[Key])))

Subsequently set the background for the columns in visual (changing the background color based on the value of the constructed measure)

vjtianmsft_0-1716953913049.png

like this:

vjtianmsft_1-1716953928067.png

vjtianmsft_2-1716953936517.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Irwan
Super User
Super User

Hello @patilpoonam21 

 

Please check if this can work for your needs.

Irwan_3-1716952889210.png

 

1. Create three measure because there are three column to be checked.

for example this is for C1 duplicate check and yellow-coloring :

C1 Color =
var _key = SELECTEDVALUE('Table'[Key])
var _C1 = SELECTEDVALUE('Table'[C1])
var _Value = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Key]=_key&&'Table'[C1]=_C1))
Return
IF(
    _Value=1,
    "#FFFF00", //yellow color code
    "")
 
_Value is for checking duplicate of Key column and C1 column while conditional if for coloring every non-duplicate value.
 
2. go to column field then select the arrow and choose conditional formating.
Irwan_1-1716952723979.png

 

3. in conditional formating, choose Field Value in format style then select the measure that made before.

Irwan_2-1716952820782.png

 

and do the same for C2 and C3.

 

Hope this will help you.

Thank you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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