Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All,
I have the following dataset and i would like to create 4 measures to get the total quantity per last 8 hours, total quantity per last 24 hours, total quantity per last 48 hours and total quantity per last 7 days.
| DateTime | Quantity |
| 19/06/2022 14:12 | 280 |
| 19/06/2022 14:11 | 280 |
| 19/06/2022 14:09 | 280 |
| 19/06/2022 14:11 | 280 |
| 19/06/2022 14:09 | 280 |
| 19/06/2022 14:12 | 280 |
| 19/06/2022 14:29 | 224 |
| 19/06/2022 14:29 | 224 |
| 19/06/2022 14:32 | 80 |
| 19/06/2022 14:22 | 80 |
| 19/06/2022 14:22 | 80 |
| 19/06/2022 14:32 | 80 |
I am not exactly sure what to specify in the SUMMARIZE () function to be able to group my data based on the above time frames.
Thank you in advance.
Solved! Go to Solution.
Click here to download a solution
Look at the measures
Nowdatetime gets the date and time of the last record.
Change this to your system time if required.
8 hoursago, 24hours ago, 48hours ago and 7days ago get the correct datetime
but subtracting TIME value from Nowdatetime
Qty in period calculates the sum of the quantity >= the selected period
Thanks for reaching out for help.
I have helped you, now please help me by giving kudos.
Remeber we are unpaid volunteers.
Click the thumbs up and accept as solution button.
One question per ticket please. If you need to extend your request then please raise a new ticket.
You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !
Click here to download a solution
Look at the measures
Nowdatetime gets the date and time of the last record.
Change this to your system time if required.
8 hoursago, 24hours ago, 48hours ago and 7days ago get the correct datetime
but subtracting TIME value from Nowdatetime
Qty in period calculates the sum of the quantity >= the selected period
Thanks for reaching out for help.
I have helped you, now please help me by giving kudos.
Remeber we are unpaid volunteers.
Click the thumbs up and accept as solution button.
One question per ticket please. If you need to extend your request then please raise a new ticket.
You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !
Thank you, I loved the date time DAX questions. Glad my solution helped you.
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!