Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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