Forum Discussion
30 days rolling
I am working on a report where I need to show rolling 30 day sales. My table has only Date and SalesAmount. The slicer can change the date range, so the calculation has to adjust automatically. I want a measure that adds up the last 30 days for whatever date is in context. What is the right way to write this?
Adam09 , First of all create a date/Calendar Table and join that with date of you table. Then use the date from date table in slcier and you can measure like
calculate([Your Measure], datesinperiod('Date'[Date],max('Date'[Date]), -30, Day) )Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
3 Replies
- amitchandakSuper User
Adam09 , First of all create a date/Calendar Table and join that with date of you table. Then use the date from date table in slcier and you can measure like
calculate([Your Measure], datesinperiod('Date'[Date],max('Date'[Date]), -30, Day) )Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.- v-dineshyaCommunity Support
Hi Adam09 ,
Thank you for reaching out to the Microsoft Community Forum.
Hi amitchandak , Thank you for your prompt response.
Hi Adam09 , could you please try the proposed solution shared by amitchandak ? Let us know if you’re still facing the same issue we’ll be happy to assist you further.
Regards,
Dinesh
- v-dineshyaCommunity Support
Hi Adam09 ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh