Forum Discussion
EktaSoni_R
2 years agoHelper I
Cummulative Sales calculation only for previous year.
Hello, I have tried to calculated only previous year cumulative sales, But unable to achive, i have tried n number of formulas but i am unable to get the output. Below dax is giving me till todays ...
- 2 years ago
EktaSoni_R
Please try this:YTD LY = IF( YEAR( MAX( 'Date'[Date] ) ) = YEAR( TODAY()), CALCULATE( CALCULATE( [Sales Amount], DATESYTD( 'Date'[Date] ) ), SAMEPERIODLASTYEAR( 'Date'[Date] ) ) )
philouduv
2 years agoResolver III
Hello EktaSoni_R,
I tried a little calculated column in a fake table that had 2 column, amount and date.
Amountdate
| 1 | 04/12/2023 |
| 2 | 26/08/2023 |
| 3 | 18/05/2023 |
| 4 | 07/02/2023 |
| 5 | 30/10/2022 |
| 6 | 22/07/2022 |
| 7 | 13/04/2022 |
| 8 | 03/01/2022 |
| 9 | 25/09/2021 |
| 10 | 17/06/2021 |
Hope it helps, if not you would need to give further details.
Formula:
cumulative_sum_previous_year = CALCULATE(SUM(Table9[Amount]),
Filter(Table9,
Table9[date].[Year] < MAX(Table9[date].[Year])
&&
Table9[date].[Year] > MAX(Table9[date].[Year]) - 2
))
Best regards,
EktaSoni_R
2 years agoHelper I
Thanks for the reply, but this solution is not working for me.