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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
JemmaD
Helper V
Helper V

Visual help - conditional formatting

Hi there,

I have a table of data and each row has an ID. There are two rows per ID. I would like to use Table formatting to somehow highlight that the two rows relate to each other, so like the alternate background colour but forcing it to be the same for the two matching ID rows? Is there any way to do this using a measure and Cell element rules? 

1 ACCEPTED SOLUTION
rsbin
Community Champion
Community Champion

@JemmaD ,

Search "power bi format table by category"
I found this link 
https://community.fabric.microsoft.com/t5/Desktop/Alternate-row-colour-after-7-rows-after-each-new-g...

EvenOdd = IF(ISEVEN(RANKX(ALLSELECTED(DailyROCStats),CALCULATE(SELECTEDVALUE(DailyROCStats[QueueDate])),,ASC,Dense)) = TRUE(),1,0)

I used [QueueDate] as my Category.  Believe you will use your [ID] field.
Hope this helps.

Regards,

View solution in original post

3 REPLIES 3
rsbin
Community Champion
Community Champion

@JemmaD ,

Search "power bi format table by category"
I found this link 
https://community.fabric.microsoft.com/t5/Desktop/Alternate-row-colour-after-7-rows-after-each-new-g...

EvenOdd = IF(ISEVEN(RANKX(ALLSELECTED(DailyROCStats),CALCULATE(SELECTEDVALUE(DailyROCStats[QueueDate])),,ASC,Dense)) = TRUE(),1,0)

I used [QueueDate] as my Category.  Believe you will use your [ID] field.
Hope this helps.

Regards,

Thanks @rsbin this worked perfectly. I had to change the default summarisation to Don't Summarize, then I got 0 and 1 in alternate rows for [ID]. I then added conditional formatting to all columns in the table using an average of this new calculated column using Gradient so min is white and max is grey and it splits the table up perfectly. Thank  you!

rsbin
Community Champion
Community Champion

@JemmaD ,

Left out the finer details in my Reply.  Glad you were able to complete the final steps and get it working for you.

Regards,

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.