Forum Discussion
Conditional Formatting
I have a column with estimated runout date and column with next order date I want to make the background of that cell red for estimated runout date if estimated runout date comes before next order date.
cingram11 - You're not giving us a lot to work with here. A screenshot, some data to work with would be helpful.
Take some time to understand the below screenshot. I've tried to colour code it so I can explain it easier.
- Create the measure that describes your rule. I've used a switch statement in this example. I don't have your data to work with and my data always evaluates to green, which is why the quantity in the matrix is showing in green.
- The light red sections (rows or columns) can't be conditionally formatted like this. Only the values (light green highlight) can be conditionally formatted in a matrix.
- Make sure you set the data type to text in your formatting measure.
- If you need to highlight your date and you need to use a matrix, you might be able to move your next order date to the values section and set the aggregation to 'Latest'.
This answer was not generated from AI because I know what I'm doing. 🤣
Hi cingram11 ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you KNP burakkaragoz for the prompt response.
I have created a PBIX file using sample data to replicate the scenario.Please go through the attached PBIX file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly.
Thank you.
7 Replies
- burakkaragozSuper User
Hi cingram11 ,
You can totally do that with conditional formatting in Power BI. Here’s how:
- Go to your table visual and select the column Estimated Runout Date.
- Click on the dropdown next to the column name in the Values section, then choose Conditional formatting > Background color.
- In the formatting window, switch to Format by: Field value.
- Create a new measure like this:
RunoutColor = IF( 'YourTable'[EstimatedRunoutDate] < 'YourTable'[NextOrderDate], "#FFCCCC", // light red BLANK() )- Use this measure as the field for background color.
This will highlight only the rows where the runout date is earlier than the next order.
Let me know if you're using a matrix or need to apply this logic differently.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Translation and formatting supported by AI
- cingram11Regular Visitor
I appreciate your quick response! I am using a matrix for this. Would this need to be applied differently?
- KNPSuper User
cingram11 - You're not giving us a lot to work with here. A screenshot, some data to work with would be helpful.
Take some time to understand the below screenshot. I've tried to colour code it so I can explain it easier.
- Create the measure that describes your rule. I've used a switch statement in this example. I don't have your data to work with and my data always evaluates to green, which is why the quantity in the matrix is showing in green.
- The light red sections (rows or columns) can't be conditionally formatted like this. Only the values (light green highlight) can be conditionally formatted in a matrix.
- Make sure you set the data type to text in your formatting measure.
- If you need to highlight your date and you need to use a matrix, you might be able to move your next order date to the values section and set the aggregation to 'Latest'.
This answer was not generated from AI because I know what I'm doing. 🤣
- v-venuppuCommunity Support
Hi cingram11 ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you KNP burakkaragoz for the prompt response.
I have created a PBIX file using sample data to replicate the scenario.Please go through the attached PBIX file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly.
Thank you.