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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
k3rz0rg
Advocate III
Advocate III

How to add 1 month to the quarter in calculated measure?

Hi all , 

 

I have a calculation that is doing sum of sales quarterly and I was using QUARTER([date]) in where condition, ie:
calculate(
                  Sum([Sales])
                  ,YEAR([date])-1 = YEAR([enddate])-1 --Looking at last year
                  ,QUARTER([date]) <= QUARTER([enddate]) --comparing quarter to quarter
)
now I wanted to add one month to that QUARTER([enddate]) , can somebody help me to do so?
Adding + 1 adds another quarter to the enddate so definitely can't use that there... 

Thanks.

4 REPLIES 4
Ray_Minds
Solution Supplier
Solution Supplier

Please provide us some sample data with your expected result.

Awm
Advocate I
Advocate I

Here is the modified version of your existing DAX formula:

 

QuarterSales = 
CALCULATE(
    SUM([Sales]),
    YEAR([date]) - 1 = YEAR([enddate]) - 1, -- Looking at last year
    QUARTER([date]) <= QUARTER(EDATE([enddate], 1)) -- Comparing quarter to adjusted quarter
)

 


In this approach, EDATE([enddate], 1) adds one month to the enddate, and QUARTER determines the new quarter based on this adjusted date.
Hope it helps!

Best regards,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sroy_16
Resolver II
Resolver II

Try using this DAX cide,

Sales QTD Adjusted =
VAR AdjustedEndDate = EOMONTH([enddate], 1)
VAR AdjustedQuarter = QUARTER(AdjustedEndDate)

RETURN
CALCULATE(
SUM([Sales]),
YEAR([date]) = YEAR([enddate]) - 1,
QUARTER([date]) <= AdjustedQuarter
)


Let me know if this solution works.

Hi @sroy_16 , thank you for your prompt response, I've tried that and weirdly, it's adding 2 months of sales instead of 1 month, I went through the documentation for EOMONTH and your one should work by adding 1 month, not sure why it's adding an extra month... Trying some more tweaks on this.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.