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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
NadeemAhamed
Helper V
Helper V

Particular cell color based on month slicer

Dear Community.

 

I am trying to apply background color for particular row cell based on selected month slicer. (Apr to Mar)

Color: Light Green

 

Ex: 

If user has selected month 

Month: Apr

Particular Cell : Division:Admin 

 

Month: May

Particular Cell : Division: IT 

 

Month: Jun

Particular Cell : Division : Transport

 

....... till Mar Particular Cell will be going to change. 

 

applying row cell is possible through DAX but i am not getting how to apply color condition with multiple if condition where one by one if condition should be execute. 

 

Thank you in adavance. 

1 ACCEPTED SOLUTION

Hi @NadeemAhamed 
You can create DAX like below (note that I did it on the part of the months to show how it works + you need 2 measures one for plan and second for actual) :

plan color =
SWITCH(SELECTEDVALUE(Sheet1[Month ]),
"apr" ,
if(SELECTEDVALUE(Sheet1[Divison])= "Admin" , "Light Green","White"),
"May",
if(SELECTEDVALUE(Sheet1[Divison])= "IT" , "Light Green","White"),
"Jun",
if(SELECTEDVALUE(Sheet1[Divison])= "Tech park Dev" , "Light Green","White"),
"Jul",
if(SELECTEDVALUE(Sheet1[Divison])= "Admin" , "Light Green","White"),
"White")
Ritaf1983_0-1719297447517.png

Result:

Ritaf1983_1-1719297475226.pngRitaf1983_2-1719297491627.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

4 REPLIES 4
NadeemAhamed
Helper V
Helper V

@Ritaf1983 

 

Thank you for your valuable time to read and respond

 

Here i have attached the excel and pbix file for your reference. 

 

pbix : https://toyotsu.box.com/s/e034h1r83v4h37weej7hwgpurpb1b100

excel : https://toyotsu.box.com/s/s3f7z18rwbze0kauuzobz6u2u564fw2l

 

In excel where ever cell has colored similary i have to color the cells in power bi table or matrix based on month slicer. 

Hi @NadeemAhamed 
You can create DAX like below (note that I did it on the part of the months to show how it works + you need 2 measures one for plan and second for actual) :

plan color =
SWITCH(SELECTEDVALUE(Sheet1[Month ]),
"apr" ,
if(SELECTEDVALUE(Sheet1[Divison])= "Admin" , "Light Green","White"),
"May",
if(SELECTEDVALUE(Sheet1[Divison])= "IT" , "Light Green","White"),
"Jun",
if(SELECTEDVALUE(Sheet1[Divison])= "Tech park Dev" , "Light Green","White"),
"Jul",
if(SELECTEDVALUE(Sheet1[Divison])= "Admin" , "Light Green","White"),
"White")
Ritaf1983_0-1719297447517.png

Result:

Ritaf1983_1-1719297475226.pngRitaf1983_2-1719297491627.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

@Ritaf1983 

 

Is it possibile to apply the condition to two or three rows?

 

NadeemAhamed_0-1719323303585.png

 

 

Ritaf1983
Super User
Super User

Hi @NadeemAhamed 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.