Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Totte67
Frequent Visitor

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

1 ACCEPTED SOLUTION

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. 
Capture1.PNG

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

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

Take the space out between "PREVIOUS" and "QUARTER"?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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

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. 
Capture1.PNG

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

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hello,

 

where do i find this file:

ContosoSalesV31_64bit.accdb

?

 

thanks for help

 

Many thanks, Lydia.

I hade no drill down, becuse i missed to put in DateKey in Axis field.

Then you told me to drill down, then I saw what I have missed.

You made my weekend 🙂

Best regards

Totte67

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.