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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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