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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Alternate color for each 3 rows

Hello All,

 

Below is  my data and I need to color (background) for each 3 rows.

Date 5/5/2021 and 5/7/2021 rows has to fill with backgorund blue colors. Rest background will be white.

 

Please suggest.

 

DateSampleP1P2P3
5/4/2021110.4110.3110.14
5/4/2021210.5210.5910.94
5/4/2021310.6910.4110.37
5/5/2021110.8410.5910.47
5/5/2021210.210.019.88
5/5/2021310.4910.3610.26
5/6/2021110.2710.6110.35
5/6/2021210.189.859.9
5/6/2021310.7810.9410.28
5/7/2021110.8410.5910.47
5/7/2021210.210.019.88
5/7/2021310.4910.3610.26
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a measure like below and use that in conditional formatting using field value option

 

meausre =

if(max(Table[Date]) >= Date(2021,5,5)  && max(Table[Date]) <= Date(2021,5,7) , "Yellow", "White")

 

You have to use this measure for conditional formatting using the field value option, use for each column

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Thank you @amitchandak . You are awesome. 

Some how I have given dummy data. Orignially I have two months data and need to color for each alternate date with yellow and while. So I have used below formula and it worked. Thanks again for your time.

 

Color = IF(ISEVEN(RANKX(ALLSELECTED('Table'),CALCULATE(SELECTEDVALUE(''[Date])),,ASC,Dense)) = TRUE(),1,0)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a measure like below and use that in conditional formatting using field value option

 

meausre =

if(max(Table[Date]) >= Date(2021,5,5)  && max(Table[Date]) <= Date(2021,5,7) , "Yellow", "White")

 

You have to use this measure for conditional formatting using the field value option, use for each column

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you @amitchandak . You are awesome. 

Some how I have given dummy data. Orignially I have two months data and need to color for each alternate date with yellow and while. So I have used below formula and it worked. Thanks again for your time.

 

Color = IF(ISEVEN(RANKX(ALLSELECTED('Table'),CALCULATE(SELECTEDVALUE(''[Date])),,ASC,Dense)) = TRUE(),1,0)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors