Forum Discussion

cingram11's avatar
cingram11
Regular Visitor
1 year ago
Solved

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.

  • KNP's avatar
    KNP
    1 year ago

    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

  • Hi cingram11 ,

     

    You can totally do that with conditional formatting in Power BI. Here’s how:

    1. Go to your table visual and select the column Estimated Runout Date.
    2. Click on the dropdown next to the column name in the Values section, then choose Conditional formatting > Background color.
    3. In the formatting window, switch to Format by: Field value.
    4. Create a new measure like this:
    RunoutColor = 
    IF(
        'YourTable'[EstimatedRunoutDate] < 'YourTable'[NextOrderDate],
        "#FFCCCC", // light red
        BLANK()
    )
    1. 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

    • cingram11's avatar
      cingram11
      Regular Visitor

      I appreciate your quick response! I am using a matrix for this. Would this need to be applied differently?

      • KNP's avatar
        KNP
        Super 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-venuppu's avatar
    v-venuppu
    Community 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.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi cingram11 ,

    I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi cingram11 ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi cingram11 ,

    I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further help.

    Thank you.