Forum Discussion
Eth
4 years agoNew Member
sumx with hierarchy
Sorry if this has been asked already but haven't been able to find anything. I have a table that looks like this: Region Branch Item Qty Requested Qty Sent Date Region A Branch 1 P...
- 4 years ago
You're grouping items together before dividing. Try calculating the ratio for each item and then averaging.
Fulfillment Rate = VAR Summary = ADDCOLUMNS ( SUMMARIZE ( Daily, Daily[Item], "@Sent", SUM ( Daily[Qty Sent] ), "@Requested", SUM ( Daily[Qty Requested] ) ), "@Ratio", MIN ( 1, DIVIDE ( [@Requested], [@Sent] ) ) ) RETURN AVERAGEX ( Summary, [@Ratio] )
AlexisOlson
Super User
4 years agoYou're grouping items together before dividing. Try calculating the ratio for each item and then averaging.
Fulfillment Rate =
VAR Summary =
ADDCOLUMNS (
SUMMARIZE (
Daily,
Daily[Item],
"@Sent", SUM ( Daily[Qty Sent] ),
"@Requested", SUM ( Daily[Qty Requested] )
),
"@Ratio", MIN ( 1, DIVIDE ( [@Requested], [@Sent] ) )
)
RETURN
AVERAGEX ( Summary, [@Ratio] )
Eth
4 years agoNew Member
Works great, thanks!