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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aharris15
Helper II
Helper II

Calculating Rolling 4 Quarters by fiscal year

Hello,

 

I tried searching around trying to figure out how to calculate a rolling 4 quarter total of units, being based on the fiscal year. I want the rolling 4 quarters to include the current quarter and then the previous 3 quarters. I have a Calendar dimension table that I added in columns to determine my fiscal year and quarter. Below is the current measure that I'm using that I found in a tutorial - while it has no errors, it also doesn't give me any results. 

 

Rolling 4 Qtr Unit Total =
var StartDay = NEXTDAY(LASTDATE(DATEADD('Calendar'[Date].[Date],-4,QUARTER)))
var EndDay = LASTDATE('Calendar'[Date].[Date])
return
CALCULATE([Total Units],DATESBETWEEN('Calendar'[Date].[Date],StartDay,EndDay))
 
 
Any help is appreciated!
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@aharris15 it is good you have a calendar dimension but you need to mark it as a date table, check my videos on times intelligence and then your measure will work, assuming start day and end day are getting calculated correctly. Learn basics of Time Intelligence DAX functions - Part 1 - YouTube

 

Rolling 4 Qtr Unit Total =
var StartDay = NEXTDAY(LASTDATE(DATEADD('Calendar'[Date],-4,QUARTER)))
var EndDay = LASTDATE('Calendar'[Date])
return
CALCULATE([Total Units],DATESBETWEEN('Calendar'[Date],StartDay,EndDay))
 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@aharris15 good to hear it is working, although it looks like a small/simple step it is super CRITICAL

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@aharris15 it is good you have a calendar dimension but you need to mark it as a date table, check my videos on times intelligence and then your measure will work, assuming start day and end day are getting calculated correctly. Learn basics of Time Intelligence DAX functions - Part 1 - YouTube

 

Rolling 4 Qtr Unit Total =
var StartDay = NEXTDAY(LASTDATE(DATEADD('Calendar'[Date],-4,QUARTER)))
var EndDay = LASTDATE('Calendar'[Date])
return
CALCULATE([Total Units],DATESBETWEEN('Calendar'[Date],StartDay,EndDay))
 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Oh wow, that seemed to work! Thank you - can't believe I missed that little step!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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