Forum Discussion
Anonymous
6 years agoNot applicable
Compare last year vs current year (months) on same visual
Hey everyone! I could use some guidance on how to create a visual that is able to show each month (last year vs current year) side by side on a stacked or clusterted bar chart. Desired Result: ...
- 6 years ago
Hi Anonymous ,
Use if statement to make conditional judgment and calculate data of each month.
Measure = IF ( ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) || YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) - 1 ) && MONTH ( MAX ( 'Table'[Date] ) ) <= MONTH ( TODAY () ) && MONTH ( MAX ( 'Table'[Date] ) ) >= 3, SUM ( 'Table'[Sales] ) )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
V-lianl-msft
Community Support
6 years agoHi Anonymous ,
Use if statement to make conditional judgment and calculate data of each month.
Measure =
IF (
(
YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () )
|| YEAR ( MAX ( 'Table'[Date] ) )
= YEAR ( TODAY () ) - 1
)
&& MONTH ( MAX ( 'Table'[Date] ) ) <= MONTH ( TODAY () )
&& MONTH ( MAX ( 'Table'[Date] ) ) >= 3,
SUM ( 'Table'[Sales] )
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.