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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
bklyn3
Advocate II
Advocate II

Using DAX for a running sum based on dates

Hello 


I have a table with OrderID, Order_Date and Ship_Date. 

I am trying to add a column with the number of Open order (i.e. ordered but not yet ship) at the day a new order is placed. 
That is at the end of day  1/1/20 only 1 order is opened, On 1/2/20 two ordered are opened but on 1/3 only 1 remains open at the end of the day. 
The end goal is to plot hte number of open orders vs. Time. 

 

OrderIDOrder_Date Ship_DateOpen Order

1100

1/1/201/3/201
11021/2/201/3/202
11031/3/201/5/201
11041/4/201/7/203
11051/4/201/8/203

 

What would be the DAX function to create the "Open Order" Column. 

Thank you



1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @bklyn3 ;

You could create a measure,

Measure = CALCULATE(COUNT('Table'[OrderID]),FILTER(ALL('Table'),[Order_Date ]<=MAX('Table'[Order_Date ])&&[Ship_Date]>MAX('Table'[Order_Date ])))

The final output is shown below:

vyalanwumsft_0-1655100844873.png


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.

View solution in original post

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @bklyn3 ;

You could create a measure,

Measure = CALCULATE(COUNT('Table'[OrderID]),FILTER(ALL('Table'),[Order_Date ]<=MAX('Table'[Order_Date ])&&[Ship_Date]>MAX('Table'[Order_Date ])))

The final output is shown below:

vyalanwumsft_0-1655100844873.png


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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.