The page finds your date table and measures in it and checks every name, so the script only refers to things that exist.
Time intelligence needs a date table with one row per day for whole years, related to your facts. The Date Table Generator can build one.
The trend needs two columns of your date table: a month label such as Jan 2026 and a month number that runs on across years (Year × 12 + Month), to count back N months. Columns you don’t have are added as calculated columns.
The measures follow SQLBI’s standard time-related calculations pattern. The script adds hidden helpers to your date table: a DateWithSales column (TRUE up to the last date with data) and, for measures, a ShowValueForDates measure, so nothing shows after your data ends and last year stops at the same day.
The measures follow SQLBI’s month-related calculations pattern: they filter month columns instead of dates, so they work on a date table with one row per month (or per day, at month level). Columns you don’t have are added as hidden calculated columns.
Tick the calculations you want and rename them if you like. Percent calculations get the percent format; the others keep each measure’s own format.
Both tables are disconnected: no relationships. The month axis goes on the chart instead of the date table, so a date slicer can pick the last month without cutting the chart down to that month.
A Current item (the measure unchanged) is always added first, so the slicer can go back to plain values. Precedence only matters if you have other calculation groups: the higher number is applied first.
Checks run as you go. Run the test query to compare a few numbers with a visual, then apply the TMDL script.