Forum Discussion
Highlight Area in Data Visualization for Emphasis - Please Help!
- 6 years ago
Hi Anonymous ,
one approach would be to create to different measures and have them both in the same chart.
As the DATEADD-function only accepts columns as input, I prefer to create a year-month number in my date table like this:
YearMonthNumber = ( YEAR ( Date[Date] ) - 2016 ) * 12 + MONTH ( Date[Date] )Your last 3 months-measure would when then look like this
Last 3 months = VAR currentYearMontNumber = ( YEAR ( TODAY () ) - 2016 ) * 12 + MONTH ( TODAY () ) RETURN CALCULATE ( SUM ( 'Sales table'[Sales] ); FILTER ( 'Date'; 'Date'[YearMonthNumber] > currentYearMontNumber - 3 ) )and the other months like this:
Other months = VAR currentYearMontNumber = ( YEAR ( TODAY () ) - 2016 ) * 12 + MONTH ( TODAY () ) RETURN CALCULATE ( SUM ( 'Sales table'[Sales] ); FILTER ( 'Date'; 'Date'[YearMonthNumber] <= currentYearMontNumber - 3 ) )Then add both measures to a chart and it will look somethink like this
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi Anonymous ,
one approach would be to create to different measures and have them both in the same chart.
As the DATEADD-function only accepts columns as input, I prefer to create a year-month number in my date table like this:
YearMonthNumber =
( YEAR ( Date[Date] ) - 2016 ) * 12
+ MONTH ( Date[Date] )
Your last 3 months-measure would when then look like this
Last 3 months =
VAR currentYearMontNumber =
( YEAR ( TODAY () ) - 2016 ) * 12
+ MONTH ( TODAY () )
RETURN
CALCULATE (
SUM ( 'Sales table'[Sales] );
FILTER ( 'Date'; 'Date'[YearMonthNumber] > currentYearMontNumber - 3 )
)
and the other months like this:
Other months =
VAR currentYearMontNumber =
( YEAR ( TODAY () ) - 2016 ) * 12
+ MONTH ( TODAY () )
RETURN
CALCULATE (
SUM ( 'Sales table'[Sales] );
FILTER ( 'Date'; 'Date'[YearMonthNumber] <= currentYearMontNumber - 3 )
)
Then add both measures to a chart and it will look somethink like this
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.