Forum Discussion
Time Intelligence
- 4 years ago
Hi KendallBrown13 ,
There're two possible reasons why the previous year value disappear, first maybe it return blank, which because of there's no value in the previous year in the sample or a incorrect formula, second maybe the previous year value and the current year value coincide. You can convert the chart to a table visual to see the specific value.
Additionally, the MonthYear column in your sample is already a date format and does not need to add .[Date] after it in the formula.
I create a sample and here's my solution.
Pre = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALL ( 'Table' ), 'Table'[MonthYear] = DATE ( YEAR ( SELECTEDVALUE ( 'Table'[MonthYear] ) ) - 1, MONTH ( MAX ( 'Table'[MonthYear] ) ), DAY ( MAX ( 'Table'[MonthYear] ) ) ) ) )It get correct result in my sample.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi KendallBrown13 ,
There're two possible reasons why the previous year value disappear, first maybe it return blank, which because of there's no value in the previous year in the sample or a incorrect formula, second maybe the previous year value and the current year value coincide. You can convert the chart to a table visual to see the specific value.
Additionally, the MonthYear column in your sample is already a date format and does not need to add .[Date] after it in the formula.
I create a sample and here's my solution.
Pre =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
'Table'[MonthYear]
= DATE ( YEAR ( SELECTEDVALUE ( 'Table'[MonthYear] ) ) - 1, MONTH ( MAX ( 'Table'[MonthYear] ) ), DAY ( MAX ( 'Table'[MonthYear] ) ) )
)
)
It get correct result in my sample.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.