Forum Discussion
Graph range conditional formatting not working with a measure
- 1 year ago
Thanks, I seem to have resolved it. I rebuilt the graph and now it's working correctly when I filter on the area so not sure what was different the first time around. I didn't need to change the measure. Note I did do a quick check as you have above with a table the same as my graph dimensions and I get a different value for each year & month as you have in your table but when I use it in the axis it takes the value that shows when I put the measure in the card, i.e the value of the total line in the table
GS76 , Try using
Min Line for Axis =
VAR _max = EOMONTH(TODAY(), 0)
VAR _min = EOMONTH(_max, -12) + 1
VAR MinLine =
SUMMARIZECOLUMNS(
'Sales'[Year & Month],
DATESBETWEEN('Sales'[Date], _min, _max),
"Total Cost Per Volume", ABS(DIVIDE(SUM('Sales'[Cost]), SUM('Sales'[Volume])))
)
RETURN
MINX(MinLine, [Total Cost Per Volume]) * 0.9
Max Line for Axis =
VAR _max = EOMONTH(TODAY(), 0)
VAR _min = EOMONTH(_max, -12) + 1
VAR MaxLine =
SUMMARIZECOLUMNS(
'Sales'[Year & Month],
DATESBETWEEN('Sales'[Date], _min, _max),
"Total Sales Per Volume", DIVIDE(SUM('Sales'[Sales]), SUM('Sales'[Volume]))
)
RETURN
MAXX(MaxLine, [Total Sales Per Volume]) * 1.1
Hi, thanks for your reply, how is this different to what I have already? I realised I made a typo on the max measure part and it should say maxx not minx but was there something else I'd made a mistake on?