Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi @Anonymous
Sure, please try this measure
Measure 1 =
var _ZeroQty = COUNTROWS(CALCULATETABLE(VALUES('Table'[sales_order_number]),'Table'[OTIF]=0))
var _total = DISTINCTCOUNT('Table'[sales_order_number])
return
IF(ISINSCOPE('Table'[sales_order_number]),IF(_ZeroQty=0,1,0),1-DIVIDE(_ZeroQty,_total))
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @Anonymous - Can you use the below measure to get calcuate the "OTIF Without Dupes" correctly
This measure uses SUMMARIZE to create a temporary table that summarizes by Location ID and Sales Order, ensuring that the distinct count and filtering logic are correctly applied.
OTIF Without Dupes =
VAR OrdersTable =
SUMMARIZE(
'SalesTable',
'SalesTable'[Location ID],
'SalesTable'[Sales Order],
"OnTime", MAX('SalesTable'[OnTimeFlag])
)
VAR TotalOrders = COUNTROWS(OrdersTable)
VAR OnTimeOrders =
COUNTROWS(
FILTER(OrdersTable, [OnTime] = 1)
)
RETURN
DIVIDE(OnTimeOrders, TotalOrders, 0)
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi @Anonymous - Modified to remove the filters in above measure can you try this?
OTIF Without Dupes V4 =
VAR OrdersTable =
SUMMARIZE(
'OTIF Showcase Sales order rollup',
'OTIF Showcase Sales order rollup'[Location ID_Desc],
'OTIF Showcase Sales order rollup'[sales_order_number],
"OnTime", MAX('OTIF Showcase Sales order rollup'[On time])
)
VAR TotalOrders =
CALCULATE(
COUNTROWS(OrdersTable),
REMOVEFILTERS('OTIF Showcase Sales order rollup'[sales_order_number])
)
VAR OnTimeOrders =
CALCULATE(
COUNTROWS(
FILTER(OrdersTable, [OnTime] = 1)
),
REMOVEFILTERS('OTIF Showcase Sales order rollup'[sales_order_number])
)
RETURN
DIVIDE(OnTimeOrders, TotalOrders, 0)
I hope it works,
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
k
@rajendraongole1 , any advice on getting the above requirement added in the measure?
j
Hi @Anonymous
Sure, please try this measure
Measure 1 =
var _ZeroQty = COUNTROWS(CALCULATETABLE(VALUES('Table'[sales_order_number]),'Table'[OTIF]=0))
var _total = DISTINCTCOUNT('Table'[sales_order_number])
return
IF(ISINSCOPE('Table'[sales_order_number]),IF(_ZeroQty=0,1,0),1-DIVIDE(_ZeroQty,_total))
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 72 | |
| 72 | |
| 38 | |
| 35 | |
| 26 |