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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need help with dax

Hi All,

I am using rolling 12 months filter on my dashboard which will return the last 12 months date ie. from 1st nov 2022 to 31st oct 2023.
I want to calculate the previous period  I was using below:
calculate(measure, dateadd(lastdate(calendar(date),-365, day)

Its giving blank value how i can get the previous period value?

3 REPLIES 3
Anonymous
Not applicable

I can't give calendar table on the dashboard. It shoudld be dyanmic. 
I have used one period table and it is connected to date dimenison (bidirectional).
By deafult my reports will have period filter as "rolling 12 months" which will give last 12 months data.
Rolling 12 months calculation:
Date.StartOfMonth(Date.AddMonths(TodaysDate,-12)), Date.EndOfMonth(Date.AddMonths(TodaysDate,-1))
so this will filter the date from 1-nov-2022 to 31-oct-2023. I want to compare the measure value to previous period.
Previous period as per me will be from 1-nov-2021 to 31-oct-2022. 





Ahmedx
Super User
Super User

It will be better for you if you create a calendar according to your financial year.
look at the file

Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Measure = calculate([measure],datesbetween(calendar[date],edate(eomonth(today(),-2)+1,-11),min(calendar[date])-1))

Measure1 = calculate([measure],sameperiodlastyear(calendar[date]))

Create slicer for Year and Month from the Calendar Table and select any one year and month.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.