Showing results for 
Search instead for 
Did you mean: 
Helper IV
Helper IV

Calculate MTD,LMTD(same period last month),QTD for Fiscal year

Hello my query is i want to calclate MTD ,LMTD and LQTD (for Fiscal year)
I want my calculations as follow
1. MTD_if my current month is june-23 I want data  from 1st june-current day(for instance 8th june)
2.LMTD-this will show data for May-23 I want data from 1st may-8th may
3LQTD(Q4 FY23)-this wil show Average of data from(jan1st-8thjan)+(feb1st-8thfeb)+(march 1st-8th march)

attaching Image for refrence ,Please help 


Super User
Super User

- do you have a calendar table?

- is it in import mode?

- is it refreshed daily?

Yes i do have calendar table and it is in import mode wirh daily refreshed 
I am sharing measures which I have tried but nothing seems to work ,Previous month calculation still giving whole month counts 
Please Help 


Capture 12 jun.PNG


You need to add calculated columns to your calendar table.


IsPastPM = [date]<=EDATE(TODAY(),-1)




Then use these columns as additional filters.


The usual caveats apply.  The shorter your periods the less useful the comparison.  Keep in mind that consecutive months rarely start on the same weekday (only March in non-leap years).

@lbendlin i got the solution for it ,could you help me out with QTD and LQTD calculations 


Same methodology.  Add a calculated column to your calendar table for each of these scenarios.

this is not working in my case 



Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
Please show the expected outcome based on the sample data you provided.

Hi , @Prajakta11 

Thanks for your sample data first!

Here are the steps you can refer to :
(1)This is my test data:


(2)We can create a calcualted column in calendar date table to get the quarter of the date:

Calendar = ADDCOLUMNS( CALENDAR( FIRSTDATE('Table'[]) , LASTDATE('Table'[])) ,"Quarter" , QUARTER([Date]))


(3)Then we can create a measure like this:

Measure = var _cur_quarter= MAX('Calendar'[Quarter])
var _pre_quarter= _cur_quarter-1
var _date= MAX('Calendar'[Date])
var _t =  FILTER(ALL('Calendar') ,'Calendar'[Quarter] = _pre_quarter && DAY('Calendar'[Date])<= DAY(_date))

SUMX(_t,  CALCULATE( SUM('Table'[Counts])))


Then we can meet your need , the result is as follows:




Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 


Best Regards,

Aniya Zhang

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

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors