Artificial intelligence continues to reshape the way we work with data, reporting, and analytics. In a recent video from Pragmatic Works, Mitchell Pearson explored one of the most exciting AI integrations in Microsoft Fabric: using Copilot to write DAX (Data Analysis Expressions). The session highlighted how Copilot can significantly accelerate development within Power BI, but also raised important considerations around accuracy and validation.
Mitchell begins by showing how Copilot is integrated directly into the DAX Query View in Power BI. By pressing Ctrl + I, users can prompt Copilot to generate DAX queries and measures within their workspace.
Mitchell first asks Copilot to create a Year-to-Date (YTD) Sales measure. Copilot generates flawless code using TOTALYTD, automatically referencing the correct sales column and date table. He highlights three key benefits:
The next scenario tested whether Copilot could handle fiscal years ending on June 30 instead of December 31. Copilot not only created the measure correctly but also populated the optional parameter in TOTALYTD to reflect the non-standard year-end. Mitchell notes this is especially useful for new DAX users who may not know about optional parameters.
Moving into more advanced territory, Mitchell challenged Copilot to create a measure returning total sales for the top five products and bottom ten products. Copilot produced sophisticated DAX involving:
TOPN to retrieve the top 5 and bottom 10 productsSUMX to iterate and calculate the total sales across the combined productsMitchell expressed surprise at how well-structured the code was. He particularly appreciated Copilot’s flexibility: different runs often produced slightly different but equally correct approaches to solving the same problem.
A standout feature was the ability to ask Copilot to explain functions like SUMX. It broke down the calculation step-by-step, making it easier for less experienced users to understand advanced DAX logic. This educational aspect adds significant value for learners.
While Copilot is powerful, Mitchell emphasized a critical caution: validation is essential. He shared that during his virtual mentoring sessions, many customers arrive with AI-generated DAX that looks correct but produces the wrong results. This can be dangerous because:
The bottom line: Copilot can accelerate development but must not replace a developer’s responsibility to test, validate, and confirm correctness.
Mitchell concludes by sharing his excitement about Copilot’s potential. It can dramatically speed up DAX development, assist with learning, and even write complex queries that would take significant time manually. However, the technology must be paired with human expertise and validation to ensure accuracy.
He invites viewers to share their experiences with Copilot—whether positive success stories or errors that slipped through. Pragmatic Works continues to support professionals through training and Virtual Mentoring programs that help users troubleshoot complex DAX and Power BI scenarios.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on DAX and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.