Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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