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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Igotzepowerbi
Frequent Visitor

Calculating a rolling 52 for qty shipped

Hi,

 

I need to get a rolling 13 for quantity shipped. 

I have this for my units shipped but it has measures that are doing funky things with matching dates. (I didn't create this measure I am just updating the report). I am new to powerbi and really don't know what I am doing - please send help lol. I need it to be based off of invoice date in my order his table. Can someone help guide me? 

Rolling 13 POS Units =

    CALCULATE (
        [sum of units],
        FILTER ( 'POS Aggregate', 'POS Aggregate'[week diff POS] <= 12 ))

I created this and its not getting me the results I am wanting. 
Rolling 13  qty shipped =
CALCULATE (
    [sum of qty shipped],  
   DATESBETWEEN('Order History'[Invoice Date], TODAY() - 91, TODAY() - 1)
)
1 REPLY 1
rubayatyasmin
Super User
Super User

Hi, @Igotzepowerbi 

 

it would be better to create a date table instead of using today(). today will eventually change everyday. 

 

modified dax

 

Rolling 13 Weeks Qty Shipped =
CALCULATE(
SUM('Order History'[Qty Shipped]),
FILTER(
ALL('Date'[Date]),
'Date'[Date] >= MAX('Date'[Date]) - 91 &&
'Date'[Date] <= MAX('Date'[Date])
)
)

 

In this measure, Date would be a separate Date table that has all of the dates and 'Order History' is the table with your shipped quantities.

This assumes that the 'Date' table and the 'Order History' table are related by the date field.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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.