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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DhirajTuteja
New Member

Issue with DAX Query

Hi,

Using Contoso Sales file in PowerBI desktop.

 

1. How to check the output of New measure created :

PreviousQuarterSales = CALCULATE(SUM(Sales[SalesAmount]), PREVIOUSQUARTER('Calendar'[DateKey]))

 

2. Dragging this measure on Report Canvas is not producing any visual. 

 

 

RegardsDAX Formula.PNG,

Dhiraj Tuteja

 

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @DhirajTuteja,

 

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

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

Hi @DhirajTuteja

To see a meaningful result, I would suggest including Year & Quarter dimensions on the axis of your visual.

You should also display a normal SUM ( Sales[SalesAmount] ) measure at the same time, so that you can compare adjacent quarters.

 

The reason you are seeing a blank result is that PREVIOUSQUARTER('Calendar'[DateKey]) returns the dates in the calendar quarter immediately preceding the quarter of the first date filtered. If you have not applied any date filters, you effectively have a "filter" including all dates in your Calendar table, so the result of PREVIOUSQUARTER will be an empty set of dates (as there are no dates before the first date in your Calendar table).

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi,

 

I am referring below link :

https://docs.microsoft.com/en-us/power-bi/desktop-quickstart-learn-dax-basics

 

Pl let me know which step I have missed.

 

Regards,

Dhiraj Tuteja

 

Hi Dhiraj,

 

I would suggest you learn something about the Visuals. Please refer to guided-learning/visualizations. Every visual has its own structure and its special meanings. We can judge a DAX formula with Right or Wrong. The result depends on the context which is determined by your purpose. For example, you need to add dates for you measure like it in the snapshot below. 

Issue-with-DAX-Query

 

Best Regards,
Dale

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors