Forum Discussion

AshokkumarM's avatar
AshokkumarM
Frequent Visitor
8 years ago
Solved

Calculate year level measure

Hi,

 

    My requirement is get to full year total of selected month or each month like below report, Could anyone help in achieving this.

 

 

Thanks,

Ashok Kumar M

  • AshokkumarM

    You may need a calendar table and measures as below.

    currentYearSales = CALCULATE(SUM(yourTable[sales]),ALLEXCEPT('calendar','calendar'[Date].[Year]))
    
    
    lastYearSales = CALCULATE(SUM(yourTable[sales]),FILTER(ALL('calendar'),'calendar'[Date].[Year]=MAX('calendar'[Date].[Year])-1))

     

      

    See more details in the attached pbix file.

1 Reply

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    AshokkumarM

    You may need a calendar table and measures as below.

    currentYearSales = CALCULATE(SUM(yourTable[sales]),ALLEXCEPT('calendar','calendar'[Date].[Year]))
    
    
    lastYearSales = CALCULATE(SUM(yourTable[sales]),FILTER(ALL('calendar'),'calendar'[Date].[Year]=MAX('calendar'[Date].[Year])-1))

     

      

    See more details in the attached pbix file.