Forum Discussion
How to apply Conditional Formatting to a column in a matrix based on "VENTA" per month
Thank you very much for your help!
However, I need it to be in a gradient. If that's not possible, I would like to have more than 5 color ranges to create a semi-gradient effect.
This measure scales "VENTA" values from 0 to 1, ensuring each month is evaluated independently.
Venta_Normalized =
VAR CurrentVenta = SUM(SalesTable[VENTA])
VAR MinVenta = CALCULATE(MIN(SalesTable[VENTA]), ALLEXCEPT(SalesTable, YourDateTable[Month]))
VAR MaxVenta = CALCULATE(MAX(SalesTable[VENTA]), ALLEXCEPT(SalesTable, YourDateTable[Month]))
RETURN
IF(
MaxVenta = MinVenta,
0.5, // To avoid division by zero, set mid-scale if all values are the same
(CurrentVenta - MinVenta) / (MaxVenta - MinVenta)
)
pply the Measure for Gradient Formatting
- Go to the blank column where you want the formatting.
- Click on Conditional Formatting → Background Color.
- Select "Field Value" and choose Venta_Normalized.
- Set a gradient color scale, for example:
- 0 (lowest sales) → Red
- 0.5 (mid sales) → Yellow
- 1 (highest sales) → Green
If this helps, I would appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!