Forum Discussion

EktaSoni_R's avatar
EktaSoni_R
Helper I
2 years ago
Solved

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 ...
  • Fowmy's avatar
    Fowmy
    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] )
            )
        )