Prompt Details
Model
(claude-4-6-sonnet)
Token size
343
Example input
[TABLE NAME]: HR
[DATE COLUMN]: Last_Review_Date
[FRESH DAYS]: 14
[RECENT DAYS]: 60
Example output
Order Freshness =
VAR vDate = SELECTEDVALUE('Orders'[Order_Date]) -- never use bare [Date]: reserved keyword
VAR vAge = DATEDIFF(vDate, TODAY(), DAY) -- age in days from today
RETURN
SWITCH(TRUE(),
ISBLANK(vDate), "No Date", -- blank check always first
vAge <= 7, "Fresh", -- within 7 days
vAge <= 30, "Recent", -- 8 to 30 days
vAge <= 90, "Stale", -- 31 to 90 days
"Outdated" -- catch-all for 90+ days
)
By purchasing this prompt, you agree to our terms of service
CLAUDE-4-6-SONNET
Generates a production-ready DAX calculated column that bands any date column into five clean freshness tiers: Fresh, Recent, Stale, Outdated, and No Date. Works for order dates, HR review dates, project milestones, financial reporting dates, or any Power BI table where row age needs to be categorised for reporting or alerting. Handles blank dates, null values, and reserved DAX keyword conflicts automatically.
...more
Added 1 week ago
