Forum Discussion
lkshck
Helper III
4 years agoAverage Cost per Day with conditional formatting
Hey, I created an measure for average cost per day, which is shown in a monthly table. In this table I want to use conditional formatting to mark if the previous month is higher, lower or the same. ...
- 4 years ago
Got it working with the following Measure:
IconAzAvg = VAR _val = CALCULATE ( AVERAGEX(VALUES('DateDimension'[Date]), [Sum_Cost]) ) - CALCULATE ( AVERAGEX(VALUES('DateDimension'[Date]), [Sum_Cost]), PREVIOUSMONTH ( 'DateDimension'[Date] ) ) RETURN SWITCH ( TRUE (), _val < 0, -1, _val = 0, 0, _val > 0, 1 )
lkshck
Helper III
4 years agoGot it working with the following Measure:
IconAzAvg =
VAR _val =
CALCULATE ( AVERAGEX(VALUES('DateDimension'[Date]), [Sum_Cost]) )
-
CALCULATE ( AVERAGEX(VALUES('DateDimension'[Date]), [Sum_Cost]),
PREVIOUSMONTH ( 'DateDimension'[Date] ) )
RETURN
SWITCH ( TRUE (),
_val < 0, -1,
_val = 0, 0,
_val > 0, 1 )