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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Dynamic Conditional formatting

Hi All,

 

I have got a matrix which shows the Team member in row and months in column. the data shows the amount of work (in terms of days) allocated to team member. Is it possible to conditional format those cells where the team member has more work than the amount of working days in a month. Every month has a different number of working days 

 

My matrix visual is below. for e.g. Person F has 21.25 days of work in Sept 20  while there are only 21 working days in sept20. Can Sept 20 column be highlighted for Person F by conditional fomratting or DAx measure ?

 

Matrix - Team MemberMatrix - Team MemberWorking Days in MonthWorking Days in Month

 

Thank you

 

Chinmay 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

You may create a measure as below.

Visual Color = 
var _date = SELECTEDVALUE('Table'[Date])
return
IF(
    SELECTEDVALUE('Table'[Person])="F"&&
    MONTH(_date)=9&&YEAR(_date)=2020,
    "Green"
)

 

Then you need to go to 'Visualizations'=>'Conditional formatting'=>'Background color', set as below.

b2.png

 

b3.png

 

Result:

b4.png

 

Best Regards

Allan

 

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

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

You may create a measure as below.

Visual Color = 
var _date = SELECTEDVALUE('Table'[Date])
return
IF(
    SELECTEDVALUE('Table'[Person])="F"&&
    MONTH(_date)=9&&YEAR(_date)=2020,
    "Green"
)

 

Then you need to go to 'Visualizations'=>'Conditional formatting'=>'Background color', set as below.

b2.png

 

b3.png

 

Result:

b4.png

 

Best Regards

Allan

 

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

 

 

amitchandak
Super User
Super User

@Anonymous ,

you can create a color measure and use that in conditional formatting using "Field Value" Option

 

example

color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)

 

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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