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?

4 days ago in Power BI by Evanjalin
• 19,000 points
40 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 4 days ago by anonymous
• 19,000 points

Related Questions In Power BI

+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,823 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,724 views
0 votes
1 answer

How to Toggle Between Two Option and Make it Interact with the rest of the Visualizations in a Report?

Toggling is an action that is achieved ...READ MORE

answered Oct 20, 2020 in Power BI by anonymous
• 65,770 points
1,186 views
+1 vote
2 answers

How can I troubleshoot the “A circular dependency was detected” error in complex DAX calculations?

The error message "A circular dependency was ...READ MORE

answered Nov 7, 2024 in Power BI by pooja
• 16,780 points
182 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,130 points
1,520 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,130 points
2,868 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,649 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 6 days ago 1,795 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 1 day ago in Power BI by anonymous
• 19,000 points
15 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