Forum Discussion
Format bar chart colours
- Anonymous4 years ago
Hi kevbrown1980 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Color = var _current=CALCULATE(SUM('Table'[MOM Fruit]),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date])))) var _last=CALCULATE(SUM('Table'[MOM Fruit]),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date])-1))) var _if= IF( _last=BLANK(),_current,_last) var _su= _current - _if return SWITCH( TRUE(), _su=0,"blue", _su>0,"red", _su<0,"green")2. Click Visual - Format - Data colors -- fx
3. Enter the Default color interface.
Format style – Field value
What field should we base this on – [color]
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi kevbrown1980 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Color =
var _current=CALCULATE(SUM('Table'[MOM Fruit]),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))))
var _last=CALCULATE(SUM('Table'[MOM Fruit]),FILTER(ALL('Table'),MONTH('Table'[Date])=MONTH(MAX('Table'[Date])-1)))
var _if=
IF(
_last=BLANK(),_current,_last)
var _su=
_current - _if
return
SWITCH(
TRUE(),
_su=0,"blue",
_su>0,"red",
_su<0,"green")
2. Click Visual - Format - Data colors -- fx
3. Enter the Default color interface.
Format style – Field value
What field should we base this on – [color]
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly