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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Lautjelief
Regular Visitor

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

@Lautjelief , 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.