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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bensiqc
Helper I
Helper I

Conditional format based on indicator and value

I'm having trouble trying to set up conditional formatting in a matrix visual that should do this:

 

If the date is 1 day before today (I have set up an indicator for this but would prefer it not be in the visualization itself) AND the number is greater than 300, highlight in yellow. If the date is 2 or more days before today (have an indicator for this as well) AND the number is greater than 300, highlight in red.

 

My table looks like the below. For example, the 452 packages listed in the 7/22 column should be highlighted in red. The 866 packages listed under 7/25 should be highlighted in yellow. The 777 packages listed under 7/26 should not be highlighted at all (as this is today as of posting time). 

 

bensiqc_0-1658873015767.png

 

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Measure for Yellow = and(today()-min(data[date])=1,[measure]>300)

Measure for red = and(today()-min(data[date])>=2,[measure]>300)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

bensiqc
Helper I
Helper I

The issue with this solution is that it results in two measures. I've read up quite a bit and I don't see a way to apply conditional formatting of one type to one table based on multiple measures. I was able to take what you gave me and combine it into one measure, though. So thanks again.

 

FORMAT = if(and(today()-min(TABLE[Date])>=2,[Packages]>300),1,if(and(today()-min(TABLE[Date])=1,[Packages]>300),2,0))

View solution in original post

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @bensiqc ,

 

Whether the advice given by @Ashish_Mathur  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

bensiqc
Helper I
Helper I

The issue with this solution is that it results in two measures. I've read up quite a bit and I don't see a way to apply conditional formatting of one type to one table based on multiple measures. I was able to take what you gave me and combine it into one measure, though. So thanks again.

 

FORMAT = if(and(today()-min(TABLE[Date])>=2,[Packages]>300),1,if(and(today()-min(TABLE[Date])=1,[Packages]>300),2,0))

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Measure for Yellow = and(today()-min(data[date])=1,[measure]>300)

Measure for red = and(today()-min(data[date])>=2,[measure]>300)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you - I can see how this lets me use a measure to get to a True / False value for each. How would I integrate this into my chart, though? I don't see an option to use either of these for conditional formatting purposes if they aren't added to the Matrix, but adding them to the matrix ruins the formatting. 

You are welcome.  Please read up on how to use measures in conditional formatting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.