Forum Discussion

Narmadha's avatar
Narmadha
Regular Visitor
4 years ago
Solved

How to get previous quarter's previous quarter data?

I want dax to get previous quarter' s previous quarter data?

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Narmadha ,

     

    To get the sum of last 2 quarter, you may try:

    Last 2 Quarters = CALCULATE(SUM('Table'[Value]),DATEADD('Table'[Date].[Date],-2,QUARTER))

    Output:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    To get previous to previous quarter's data, enclose PREVIOUSQUARTER with another PREVIOUSQUARTER.

    Below is an example for a measure

    PREVIOUSQUARTER Data:=CALCULATE(SUM(Table3[Amount]),PREVIOUSQUARTER(PREVIOUSQUARTER('Calendar'[Date])))
    • cn4422's avatar
      cn4422
      Icon for Helper V rankHelper V

      Thx, that really works, haha, awesome! 😍

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Narmadha ,

     

    To get the sum of last 2 quarter, you may try:

    Last 2 Quarters = CALCULATE(SUM('Table'[Value]),DATEADD('Table'[Date].[Date],-2,QUARTER))

    Output:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.