Forum Discussion
cooksteve09
4 years agoFrequent Visitor
Conditional Formatting using calculated measure
Please help!! What i am after seeing in the "If_Red" column is, if the value has increased on previous week then green, red if decrease and blue if equal, below is an example of my data and my ca...
- 4 years ago
Please try:
Column = var current_ = 'Table'[Index] var next = current_+1 var base_line = MAX('Table'[Index]) var current_value = 'Table'[filled] var next_value = CALCULATE(SUM('Table'[filled]),FILTER('Table','Table'[Index]=next)) return SWITCH(TRUE(), 'Table'[Index]=base_line,"black", current_value>next_value,"green", current_value<next_value,"red", current_value=next_value,"blue" )
cooksteve09
4 years agoFrequent Visitor
Thank you parry2k but its not quite right
Step 2 should be green because its greater then step 3 and step 3 should be blue because its equal to step 4, step 4 should be green because its greater then step 5 and step 5 should be black because thats the base line
does that make sense? any idea how i get it to work that way?
V-lianl-msft
4 years agoCommunity Support
Please try:
Column =
var current_ = 'Table'[Index]
var next = current_+1
var base_line = MAX('Table'[Index])
var current_value = 'Table'[filled]
var next_value = CALCULATE(SUM('Table'[filled]),FILTER('Table','Table'[Index]=next))
return SWITCH(TRUE(),
'Table'[Index]=base_line,"black",
current_value>next_value,"green",
current_value<next_value,"red",
current_value=next_value,"blue"
)
- cooksteve094 years agoFrequent Visitor
Thank you, this is almost perfect except the baseline is only applying to the largest number of one ID, i need it to apply to each ID's largest Step number....tried several things but i just cant quite get the DAX right