Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
07-23-2025 10:36 AM
With date tables, we often have columns for things like month name (Jan/Feb/March/etc), day of week (Sunday, Monday, etc). We want these sorted in chronological order, not the alphabetical default. We also tend to want date-type fields to be formatted with a short date instead of a long date like "Saturday, March 1, 2025". We can do both of these at once by having an LLM modify the TMDL script.
Drag your not-yet-formatted-or-sorted date table TMDL into the TMDL window to get the current column configurations, then feed it to the LLM with a prompt.
Here's an example prompt:
Here is my date table TMDL from Power BI.
{paste TMDL for date table here}
TASKS:
TASK 1
Add a line to each TEXT type column for sortByColumn, giving it a reference to the equivalent numeric or date type column in the code. Do not omit or change the Power Query text in your response.
TASK 2
Date fields should be formatted in short date format. Add this format string text to the date-type column TMDL. Only add this to date-type fields, not text or numeric.
formatString: m/d/yyyy