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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Determination of Fill Rate per order line and complete order

Cordial greetings to the community!

I come to you for help in managing DAX to create fill rate measures and size the performance of a company.

The base I am using contains the detail of each order line; that is, the items requested in each of the orders.
For the "Line Fill Rate" create a measure that compares the customer's Demand against the Quantity Delivered (Sale) in order to know how many items were delivered according to the customer in each of the orders.

The measurement was calculated as follows:

Line Fill Rate 23 =
WHERE _Tablasumm =
SUMMARIZE(
FILTER('BD Ventas GCM', 'BD Ventas GCM'[Quantity 2023] <> BLANK()
),
'BD Ventas GCM'[Order],
'BD Ventas GCM'[Article],
"Sale", CALCULATE(SUM('BD Ventas GCM'[Quantity 2023]), 'BD Ventas GCM'[Quantity 2023] > 0),
"Return", CALCULATE(SUM('BD Ventas GCM'[Quantity 2023]), 'BD Ventas GCM'[Quantity 2023] < 0),
"Demand", CALCULATE(SUM('BD Ventas GCM'[Amount between]), 'BD Ventas GCM'[Quantity 2023] > 0)
)
WHERE _Check =
ADDCOLUMNS(
_Tablasumm,
"Assortment",
WHERE _LFR = DIVIDE([Sale], [Demand])
return
IF(_LFR >= 0.99, "OK", "Error"
)
)
WHERE _TablaLFR =
ADDCOLUMNS(
_Check,
"LFR",
IF([Return] <> 0, "Error", [Assortment]
)
)
WHERE Fill_Rate =
DIVIDE(
COUNTX(FILTER(_TablaLFR, [LFR] = "OK"), [LFR]),
COUNTX(_TablaLFR, [Sale]),
0
)
return
Fill_Rate
Looking at it as a table it would be something like this:
LuisMoreno96_0-1694647487675.png

Line Fill Rate [LFR] excludes those order lines that have returns.

My problem is when calculating which orders are error-free.

I understand that I should do a Distinctcount of the [Order] column and remove the segmentation from the [Article] column but I do not know how to execute this formulation in a single measure.

I would greatly appreciate your support

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.