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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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