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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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