Forum Discussion

AUaero's avatar
AUaero
Icon for Responsive Resident rankResponsive Resident
4 years ago
Solved

Unexpected Result With Matrix Conditional Formatting

Hi all, I'm getting an unexpected result when applying conditional formatting to a matrix visual.

Take a look at this formatted column.  The conditional formatting is set up as a gradient with the lowest value red, the highest value green, and the middle value white.

 

Here's the column that I'm applying the conditional format to.  $85,694 is the median value for this set.

 

Based on this rule, I would expect $85,694 to be white with all values above shading toward green and all values below shading toward red.  Instead Power BI is formatting $112,198 as the middle value.

Any ideas on this behavior?

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi AUaero ,

    According to the reply from the product group, Power BI implements the color gradient as a linear scale. You can set the Middle to a different value if you want, but by default Middle is the average of min/max.

    They will take the idea from you into consideration for adding more Auto options to "middle".

     

    Best Regards

    Community Support Team _ Polly

     

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

15 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AUaero ,

    Have submited this issue internal to confirm(ICM: 329637339), would update here as soon as possible if there is any update about it.

     

    Best Regards

    Community Support Team _ Polly

     

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

  • The "Center" is most likely the average, not the median.

    • AUaero's avatar
      AUaero
      Icon for Responsive Resident rankResponsive Resident

      The average of this set of number is 91,802.

  • Hi,

    What do you want to treat as the middle value - mean or median?  Share the link from where i can download your PBI file.

    • AUaero's avatar
      AUaero
      Icon for Responsive Resident rankResponsive Resident

      I would expect the middle value to the median, but I haven't found any documentation regarding conditional formatting that explains exactly what Power BI treats as the middle value.  Regardless, the value that is highlighted as the middle is neither the mean nor the median.

      I can't share the full PBIX but I've created a stripped down version that replicates the problem.  As you can see, Power BI is treating the middle value as 103,391 while the median is 88,794 and the average is 92,752.

      I can't  share the the full PBIX due to confidentiality concerns, but here's a link to a simplified and sanitized version.

      https://1drv.ms/u/s!AtHPCBKFQogGgsM-5tPOl07xWgWLjQ?e=hrveq0

  • It is likely caused by your nested measures.  The formatting works as expected for simple values

     

     

    • AUaero's avatar
      AUaero
      Icon for Responsive Resident rankResponsive Resident

      lbendlin I think you just got lucky with the set you tested with.  The average of the min and max ((7+1)/2) is 4, which is also happens to be the median of your set.  I tested using just a bunch of random numbers and get the same result as I do with the nested measures in the PBIX.  The median of this set is 48, but that isn't in the middle of the highlighted area.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AUaero ,

    According to the reply from the product group, Power BI implements the color gradient as a linear scale. You can set the Middle to a different value if you want, but by default Middle is the average of min/max.

    They will take the idea from you into consideration for adding more Auto options to "middle".

     

    Best Regards

    Community Support Team _ Polly

     

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