Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi Everyone,
My question is, how do I find the sum of prior qty available in the past 13 weeks starting from today and going back 13 weeks.
Here is a mock dataset of the main table. This table is further connected to another table called 'Fiscal Calendar table' and is conencted via 'file date column'.
The method i used is:
| SKU | Province | prior qty available (cases) | total requested(cases) | total sold(cases) | file date |
| 1 | AB | 20 | 10 | 7 | 25/02/2022 |
| 2 | AB | 34 | 27 | 26 | 28/03/2022 |
| 3 | AB | 23 | 13 | 10 | 13/04/2022 |
| 4 | AB | 12 | 11 | 8 | 17/05/2022 |
| 5 | AB | 22 | 17 | 18 | 1/6/2022 |
| 6 | AB | 31 | 28 | 27 | 15/07/2022 |
| 7 | AB | 7 | 2 | 1 | 20/08/2022 |
Hi, @Anonymous ;
Try it.
L13W Requested Index =
VAR L13R = CALCULATE(SUM([total requested(cases) ]),DATESINPERIOD('Table'[file date ],
TODAY(),-91,DAY))
VAR L13A = CALCULATE(SUM([total sold(cases)]),DATESINPERIOD('Table'[file date ],
TODAY(),-91,DAY))
return
IFERROR(L13R/L13A,1.5)
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
I have already tried using TODAY(), but it gives me a blank result in the coloumn.
Hi, @Anonymous ;
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Instead of the MAX filedate, use TODAY(). see this link for a description of the function and its caveats:
https://docs.microsoft.com/en-us/dax/today-function-dax
Also, please take a look at the function DIVIDE(). It is considered best practise to avoid divisions using "/".
Martijn
Hi Martijn,
I have already tried TODAY() in place of MAX, but I get a blank data result on doing so.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 30 | |
| 26 | |
| 23 | |
| 23 | |
| 14 |
| User | Count |
|---|---|
| 46 | |
| 33 | |
| 20 | |
| 18 | |
| 16 |