YTD
YTD(expr, dateCol) · Time intelligence
Accumulates expr from the start of the year through each date bucket (a window SUM partitioned by year). The operand must be additive — a linear combination of Sum/Count aggregates (measure references included; Avg is admitted via sum/count decomposition). Anything else fails with SQX015.
Example
Section titled “Example”RevenueYTD := YTD([Revenue], Date.Date)
// Ratios: accumulate the parts, then divideAOVYTD := Divide(YTD([Revenue]), YTD([Orders]))YTD([AvgOrderValue]) is rejected — a running sum of per-bucket ratios is silently wrong.