Prompt Details
Model
(claude-4-6-sonnet)
Token size
420
Example input
[TABLE NAME]: Orders
[GROUP COLUMN]: Customer_ID
[AGGREGATION TYPE]: SUMX
[NUMERIC COLUMN]: Order_Value
Example output
Customer Total Orders =
VAR vResult =
CALCULATE(
SUMX('Orders', 'Orders'[Order_Value]), -- sum all order values in group
ALLEXCEPT('Orders', 'Orders'[Customer_ID]) -- keep only the customer group filter
)
RETURN
IF(ISBLANK(vResult), BLANK(), vResult) -- return BLANK not zero for empty groups
By purchasing this prompt, you agree to our terms of service
CLAUDE-4-6-SONNET
Generates a production-ready DAX calculated column that propagates any row-level numeric value to the group level using MAXX or SUMX with ALLEXCEPT. Works for order totals per customer, budget rolled up per department, peak scores per project, or any dataset where each row must reflect a group-wide aggregation. Handles blank values, context transitions, and ALLEXCEPT scoping errors automatically.
...more
Added 3 weeks ago
