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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors