Forum Discussion

Totte67's avatar
Totte67
Frequent Visitor
10 years ago
Solved

Measure Previous Year, get no data

have trouble seeing the previous year eg
I have set up a mesure
Previous Quarter Sales = CALCULATE (SUM (Sales [Sales Amount]) PREVIOUS QUARTER (Calendar [DateKey]))
This has always worked in the past but now I can not provide any data at all,
is there anyone else who has the same problem?

 

Best regards

Totte67

  • Anonymous's avatar
    Anonymous
    10 years ago

    Hi Totte67

     

    Based on my test, the Previous Quarter Sales measure works as expected. For example, after you create a column chart, dill down the date to quarter as shown in the following screenshot, you will see the sales amount of Previous Quarter in different years. 


    For more details, please review the attached PBIX file:https://1drv.ms/u/s!AhsotbnGu1NogW7rJtVIRlbhJdR0.

     

    Thanks,
    Lydia Zhang

6 Replies

    • Totte67's avatar
      Totte67
      Frequent Visitor

      Sorry the code is
      Previous Quarter Sales = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER(Calendar[DateKey]))

      I have tried all possible combinations, but may not generate data.
      This code is copied from Contso test report, which has always worked but not now.
      I do not know if there is any update in Power BI Desktop, so that this does not work.
      I have downloaded the Contoso Sales Sample of Power BI Desktop and Test Their DAX code With The Same result no data.

      Just to see if I hade done something wrong, but everything look right.

      Thanks
      Totte67

    • Totte67's avatar
      Totte67
      Frequent Visitor

      Sorry the code is
      Previous Quarter Sales = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER(Calendar[DateKey]))

      I have tried all possible combinations, but may not generate data.
      This code is copied from Contso test report, which has always worked but not now.
      I do not know if there is any update in Power BI Desktop, so that this does not work.
      I have downloaded the Contoso Sales Sample of Power BI Desktop and Test Their DAX code With The Same result no data.

      Just to see if I hade done something wrong, but everything look right.

      Thanks
      Totte67

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Totte67

         

        Based on my test, the Previous Quarter Sales measure works as expected. For example, after you create a column chart, dill down the date to quarter as shown in the following screenshot, you will see the sales amount of Previous Quarter in different years. 


        For more details, please review the attached PBIX file:https://1drv.ms/u/s!AhsotbnGu1NogW7rJtVIRlbhJdR0.

         

        Thanks,
        Lydia Zhang