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
Anonymous
Not applicable

How to calculate sales per quarter with DAX

Im trying to make a graph that only shows the sum of sales between each quarter. The periods start and end on the 26th of jan, apr, jul and oct. This is the result Im looking for (excuse the questionable Paint skills)

Lautjelief_1-1701099159660.png

Ive tried doing this by using the window function, but it just gives me the output of the future, not the past. Also I cannot seem to figure out how to set the period start and end date to the 26th. Here is my DAX measure:

SUMX(
WINDOW(
1,ABS,
1, ABS,
SUMMARIZE(ALLSELECTED('[DIM] Date'),
'[DIM] Date'[Year],
'[DIM] Date'[Quarter]),
ORDERBY('[DIM] Date'[Year], ASC, '[DIM] Date'[Quarter], ASC),
DEFAULT, PARTITIONBY('[DIM] Date'[Quarter])),
[Total sales])

 

What am I doing wrong?? I watched countless videos but still cannot figure it out

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , This will give sales of qtr for each date or month

 

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

 

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors