AI and ML have come a long way in the past decade, transforming how we develop software and applications. One of the most impressive examples is OpenAI’s Codex, a system that can generate code from natural language descriptions. Codex powers Copilot, a tool that helps developers write better code faster and easier. In this blogpost I am going to express my opinion about this sophisticated technology and its integration with my favourite data platform, Power BI, well, I mean Microsoft Fabric.
What is Copilot, and how does it work?
Copilot is an AI-powered tool that provides suggestions for code completion and documentation as you type. It works as an extension for Visual Studio Code and GitHub Codespaces. Copilot can understand the context and intent of your code and generate relevant suggestions that match your coding style and best practices. You can accept, reject, or modify the suggestions as you wish.
Copilot is not just a code autocomplete tool. It can also help you write tests, implement new features, fix bugs, and learn new frameworks or languages. Copilot can even generate code from plain English comments or queries, such as “Create a function that adds two numbers” or “How do I sort a list in Python?”. It’s amazing, isn’t it?
How does Copilot integrate with Power BI?
Power BI is a powerful data analysis and visualisation platform that enables you to connect to various data sources, transform and model your data, create interactive reports and dashboards, and share your insights with others. Power BI also supports custom visuals and extensions that can enhance your data experience.
Copilot is one of the new extensions that integrate with Power BI, bringing the power of Codex to data analysts and developers. Copilot can help you write DAX formulas, changes the data model, add visuals to the report page and even create a complete report in Power BI from natural language queries or comments, such as “show me the sales by region and product category” or “create a pie chart of customer satisfaction ratings”. You may have already tasted some of the above; for instance, you may have already used the Smart Narrative visual in your Power BI reports. Or you may have used the Auto-create report feature in Power BI Service, I mean, Fabric, on an existing dataset.
But with Copilot, you can ask questions such as “Create a report to show sales by region and top 10 best-selling products”, and Copilot creates the report for us in seconds. This is pretty cool, right? But this tool, like any other tool, has some limitations. Let’s touch on those as well.
Limitations and considerations
Copilot in Power BI is still in private preview mode and has not been publicly released yet. It was announced in Microsoft Build 2023 alongside the big massive announcement of Microsoft Fabric, a new platform that unifies Microsoft’s cloud services and products under one umbrella.
Copilot in Power BI is not a replacement for human intelligence or creativity. It is a tool that can assist you with your data tasks but cannot guarantee the accuracy or quality of the code or insights it generates. You should always review and verify the suggestions from Copilot before using them in your projects. The human brain is required to solve more complex or very specific challenges, especially when working on larger data models with many active, inactive, regular and limited relationships, Incremental refreshes with hybrid tables or user-defined aggregations. Therefore, we need to set our expectations right.
Copilot in Power BI is also not a substitute for learning or understanding the concepts and languages behind Power BI. You should still have a basic knowledge of DAX, M, data modelling, and Power BI features before using Copilot. Copilot can help you learn new things or improve your skills by providing examples and explanations for its suggestions. So I strongly suggest you still read blogs, watch tutorial videos on YouTube and read books. On the latter, the second edition of my book, Expert Data Modeling with Power BI, was released last month.
Copilot in Power BI is an exciting new extension that can enhance your data experience with Power BI. It can help you write code faster and easier, create reports and dashboards more efficiently, and discover new insights more effectively. Watch the following video to get a sense of what we can do with Copilot from a Power BI development perspective: