Prompt Details
Model
(claude-4-6-sonnet)
Token size
326
Example input
[TABLE NAME]: Orders
[CATEGORY A]: Inactive
[CATEGORY B]: Priority
[VALUE LIST]: Express, Priority, Same-Day
[CATEGORY C]: Standard
Example output
Order Category =
VAR vStatus = SELECTEDVALUE('Orders'[Order_Status]) -- never use bare [Status]: reserved keyword
VAR vType = SELECTEDVALUE('Orders'[Order_Type])
VAR vList = {"Express", "Priority", "Same-Day"}
RETURN
SWITCH(TRUE(),
ISBLANK(vStatus) || vStatus = "Cancelled", "Inactive", -- blank check always first
CONTAINSROW(vList, vType), "Priority", -- list match via CONTAINSROW not IN
"Standard" -- catch-all
)
By purchasing this prompt, you agree to our terms of service
CLAUDE-4-6-SONNET
Generates a production-ready DAX calculated column that classifies any Power BI table column into three custom categories using list matching and status-based logic. Works for asset classification, order status, project phase, HR onboarding, inventory categorisation, or any dataset where rows need bucketing into named groups. Handles blank values, reserved keyword conflicts, and measure-vs-column errors automatically.
...more
Added 1 week ago
