Forum Discussion

maurcoll's avatar
maurcoll
Helper IV
1 year ago
Solved

Previous Quarter Comparison

Hi

i need to produce the below table where it is comparing the previous 2 complete quarters. In the below example it would be financial Q4 compared to financial Q3 as we are currently in financial Q1. Next quarter it would be Financial Q1 compared to Financial Q4. I have a date calendar where the financial quarter number is stored as a number and a financial year column also stored as a number.

 Last QuarterPrevious Quarter% Difference
Total Sales1234234510%

 

Thank you for your help

  • maurcoll's avatar
    maurcoll
    1 year ago

    Hi

     

    I ended up using the previousquarter function which has worked. I just need to add the Quarter Year into a slicer

6 Replies

  • Hello maurcoll 

     

    please try this measure

     

    Last Completed YearQuarter =

    VAR CurrentYear = MAX('Date'[FinancialYear])

    VAR CurrentQuarter = MAX('Date'[FinancialQuarter])

    -- Completed quarter is always one before the current

    RETURN

    IF(CurrentQuarter = 1,

        (CurrentYear - 1) * 10 + 4, -- Q4 of previous year

        CurrentYear * 10 + (CurrentQuarter - 1)

    )

     

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

    • maurcoll's avatar
      maurcoll
      Helper IV

      Hi

      I'm getting a value of 20283, my calendar table goes forward to 2028.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi maurcoll ,

    We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
    If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Regards,
    Chaithra.

    • maurcoll's avatar
      maurcoll
      Helper IV

      Hi

       

      I ended up using the previousquarter function which has worked. I just need to add the Quarter Year into a slicer

      • v-echaithra's avatar
        v-echaithra
        Community Support

        Hi maurcoll ,

        Please accept the solution that have resolved your issue, as it would be helpful for other community members.

        Regards,
        Chaithra E.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi maurcoll ,

    May I ask if you have gotten this issue resolved?

     

    If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

     

    Regards,

    Chaithra E.