Forum Discussion
Anonymous
7 years agoNot applicable
Conditional Formatting based on previous Value
Hi, I have the above table as a Matrix in Power BI: MONTH TICKETS UPDATED # STOCK REPLENISHED # INCREASED MPL / MDQ # May 2019 9 48 10 June 2019 11 47 9 July 2019 8 52 ...
- Anonymous7 years ago
Hi Anonymous
I did an example for 1 column.
Create 2 new columns:Previous Month Tickets = VAR prev_month = PREVIOUSMONTH ( T13[MONTH] ) RETURN IF ( CALCULATE ( SUM ( T13[TICKETS UPDATED #] ), FILTER ( T13, prev_month = T13[MONTH] ) ) = BLANK (), 0, CALCULATE ( SUM ( T13[TICKETS UPDATED #] ), FILTER ( T13, prev_month = T13[MONTH] ) ) )Colors = IF ( T13[TICKETS UPDATED #] > T13[Previous Month Tickets], "GREEN", "RED" )Then format according to field value
Cheers!
A
Anonymous
7 years agoNot applicable
Hi Anonymous
I did an example for 1 column.
Create 2 new columns:
Previous Month Tickets =
VAR prev_month =
PREVIOUSMONTH ( T13[MONTH] )
RETURN
IF (
CALCULATE (
SUM ( T13[TICKETS UPDATED #] ),
FILTER (
T13,
prev_month = T13[MONTH]
)
)
= BLANK (),
0,
CALCULATE (
SUM ( T13[TICKETS UPDATED #] ),
FILTER (
T13,
prev_month = T13[MONTH]
)
)
)Colors =
IF (
T13[TICKETS UPDATED #] > T13[Previous Month Tickets],
"GREEN",
"RED"
)Then format according to field value
Cheers!
A
Anonymous
7 years agoNot applicable
You can optimise the above to be in one column (one go),
I did it in 2 steps for better understanding the steps.
Good Luck!