I need to calculate a running total but reset it at the start of each new quarter how can I achieve this in DAX

0 votes

I need to calculate a running total but reset it at the start of each new quarter—how can I achieve this in DAX?
You need to create a DAX measure that calculates a running total but resets the total at the beginning of each quarter. How can you structure this calculation using functions like CALCULATE, FILTER, or TIME INTELLIGENCE functions to ensure correct results across different time periods?

Mar 7 in Power BI by Evanjalin
• 25,690 points
86 views

1 answer to this question.

0 votes

To calculate a running total that resets at the start of each quarter, you can use CALCULATE and FILTER in DAX while leveraging the DATESQTD function for quarter-based calculations.

DAX Measure for Running Total (Quarterly Reset)

RunningTotal_Quarterly =  
CALCULATE(  
    SUM( 'Sales'[Amount] ),  
    FILTER(  
        ALLSELECTED( 'Sales' ),  
        'Sales'[Date] >= STARTOFQUARTER( 'Sales'[Date] ) &&  
        'Sales'[Date] <= MAX( 'Sales'[Date] )  
    )  
)

Explanation

  1. ALLSELECTED('Sales') ensures that the measure respects slicers but still evaluates the full date range within the selected period.
  2. STARTOFQUARTER('Sales'[Date]) determines the first date of the current quarter.
  3. FILTER ensures that the sum includes all dates from the quarter start up to the current date in context.

Alternative Approach Using TIME INTELLIGENCE

If you have a separate Date Table, use DATESQTD for better time intelligence support:

RunningTotal_Quarterly =  
TOTALQTD( SUM('Sales'[Amount]), 'Date'[Date] )



answered Mar 7 by anonymous
• 25,690 points

Related Questions In Power BI

0 votes
1 answer
0 votes
1 answer

I need to show a trendline for a moving average but only for selected date ranges—how can I do this?

To do a Moving Average Trendline that ...READ MORE

answered Mar 19 in Power BI by anonymous
• 25,690 points
53 views
+1 vote
1 answer

Need a DAX : To check the new escalations arrived, on the change of the escalation counter from zero to one or more

Yes exactly !  i need a measure for ...READ MORE

answered Sep 3, 2019 in Power BI by anonymous

edited Sep 3, 2019 1,877 views
0 votes
1 answer

In DAX, how do I RETURN the sum of a calculated column from a DAX Table Variable (created via ADDCOLUMN)?

You can access column variables of previously ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,770 points
4,768 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,090 points
1,595 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,090 points
2,934 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,719 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Open power bi report nd sign in ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited Mar 5 1,881 views
0 votes
1 answer
0 votes
1 answer

I need to compute a year-over-year (YoY) growth rate but only for months where I have data in both years—how do I do this?

Calculating Year-over-Year (YoY) growth only for those ...READ MORE

answered Mar 10 in Power BI by anonymous
• 25,690 points
61 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP