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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Conditional formatting in visual for multiple duplicates

My question is related to this question: Solved: Conditional Formatting Duplicate Records in Rows - Microsoft Power BI Community.

 

Specifically, I want to mark those rows in a visual which are duplicates. However, the answer in that question only works if there is only one duplicate. I can have more than 2, hence to mark when distinct count is 2 will not be sufficient.

 

How can I achieve this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create a measure as below to get the count of systems which per user logged into

Countofsystem = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[System] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Current User] = SELECTEDVALUE ( 'Table'[Current User] )
    )
)

2. Create a measure as below to make conditional formatting rule

Conditional formatting = IF ( [Countofsystem] >= 2, "Red" )

3. Configure conditional formatting: select the visual and click the field "Current User", Conditional formatting-->Background color

yingyinr_0-1636009787020.png

Best Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

1. Create a measure as below to get the count of systems which per user logged into

Countofsystem = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[System] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Current User] = SELECTEDVALUE ( 'Table'[Current User] )
    )
)

2. Create a measure as below to make conditional formatting rule

Conditional formatting = IF ( [Countofsystem] >= 2, "Red" )

3. Configure conditional formatting: select the visual and click the field "Current User", Conditional formatting-->Background color

yingyinr_0-1636009787020.png

Best Regards

Thanks a lot!!! It did work!!!

Pragati11
Super User
Super User

HI @Anonymous ,

 

I would suggest creating another column on top of the calculated column suggested in the above solution on the forum:

countFlag = 
IF(CountDistinct > 1, 1, 0)
   

 

Then use this column for conditional formatting. So, countFlag = 1 is taking into account all the duplicates with count more than 1.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

I created the columns as you suggested, however when I go to conditional formatting and select field, I can not select calculated columns.

 

Could you suggest how to workaround this?

Hi @Anonymous ,

 

You select the column in conditional formatting in the same way shown in the thread that you used for reference:

https://community.powerbi.com/t5/Desktop/Conditional-Formatting-Duplicate-Records-in-Rows/m-p/690739

 

Also it is always good to have some screenshots so that I can understand what you have done and trying to do 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.