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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mattkarriker
Helper I
Helper I

Roll up Calculations

Hello Forum

Having an issue and I am not sure how to complete.  I am looking for a way to compute order fill rate at different levels.  The first level is at the line level.  I need to compute the percentage that the line was filled.  I get this pretty easily.  I then need to score the line as 100% filled or not with a calculation to return yes or no.  At the order level I need to know how many lines were 100% filled / total order lines for a percentage of lines filled.  This is where I run into issues.  Below is a simplified view of the data and attempts as the needed calcs.  Any suggestions?  Thank you in advance for your help. 

 

Order NumberLine NumberOrderLine_keyCancelled Qty Shipped QtyBackordered Qty   
111-1 2    
121-2221   
131-3 5    
141-42     
         
         
Calcs 
Order Qty = Cancelled Qty + Shipped Qty + Backordered Qty
Line Fill Rate = Shipped Qty/Order Qty
Line Filled = If Line Fill Rate = 1 then Yes else No
Order Line Fill Rate = Cacluate(DistinctCount(Line_Key),Line Filled = Yes)/DistinctCount(Line_Key)
         
         
Order NumberLine NumberOrderLine_keyCancelled Qty Shipped QtyBackordered QtyOrder QtyLine Fill RateLine Filled
111-1 2 21Yes
121-222150.4No
131-3 5 51Yes
141-42  20No
         
Order NumberOrder Line Fill Rate       
10.5       
1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @mattkarriker,

 

In your scenario, please create calculated columns like below:

 

Oder Qty = Table1[Cancelled Qty] +Table1[Shipped Qty] +Table1[Backordered Qty]
Line Fill Rate = DIVIDE(Table1[Shipped Qty],Table1[Oder Qty],0)
Line Filled = IF(Table1[Line Fill Rate]=1,"Yes","No")

 

Then create a measure like this:

 

Order Line Fill Rate = DIVIDE(CALCULATE(DISTINCTCOUNT(Table1[OrderLine_key]),FILTER(ALL(Table1),'Table1'[Line Filled]="Yes")),CALCULATE(DISTINCTCOUNT(Table1[OrderLine_key]),ALL(Table1)))

 

z3.PNG

 

You can download attached .pbix file to have a look.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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-qiuyu-msft
Community Support
Community Support

Hi @mattkarriker,

 

In your scenario, please create calculated columns like below:

 

Oder Qty = Table1[Cancelled Qty] +Table1[Shipped Qty] +Table1[Backordered Qty]
Line Fill Rate = DIVIDE(Table1[Shipped Qty],Table1[Oder Qty],0)
Line Filled = IF(Table1[Line Fill Rate]=1,"Yes","No")

 

Then create a measure like this:

 

Order Line Fill Rate = DIVIDE(CALCULATE(DISTINCTCOUNT(Table1[OrderLine_key]),FILTER(ALL(Table1),'Table1'[Line Filled]="Yes")),CALCULATE(DISTINCTCOUNT(Table1[OrderLine_key]),ALL(Table1)))

 

z3.PNG

 

You can download attached .pbix file to have a look.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.