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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Why PreviousQuarter for Contuso is not working?

I tried to create new Measure for calculating SalesAmount for Previousyear, but it is not producing any value. Why not?

 

PowerBI_Previous_Quarter_Contuso.png

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

There‘s no problem with you measure.

For the selected quarter, if there is no data for the previous quarter, it will appear ‘blank’.

For example, there is no data for the 2010 Quarter/4 ,so  it will appear ‘blank’ when  you  check the fourth quarter of 2011.

1.png

Here is a sample I made.

URL: https://wicren-my.sharepoint.com/:u:/g/personal/michael_wicren_onmicrosoft_com/EWYpCOUP_FBDrE9RbGEMfFEB2-PdcGrMiBXNi_V2CxkXmQ?e=hHYFp0

 

3.png

If I  misunderstood your question, please let me know.

 

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

amitchandak
Super User
Super User

You want last qtr or last year same qtr

 

Try these

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date Filer])))

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date Filer],-1,Year)))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.