// Copilot in Fabric
The Microsoft Copilot service is now in preview in Microsoft Fabric (as of March 2024).
This post is a run down of the different experiences, what to expect of the services and how to work with them.
Enable Copilot in Fabric
If you are living outside the USA or France, you need to manually enable the Copilot service in the Fabric tenant. To do this, you go to the tenant settings of youor Fabric service annd find the “Copilot annd Azure OpenAI service (preview)” setting.
Please be aware the processing of data can happen outside of the configured tenant settings as stated below:
4 different Copilot experiences
Or actually only 3 - but I’ll get back to that in a moment.
From the Microsoft documentation we get access to 4 Copilots in Fabric.
- Data Factory
- Data Science
- Data Engineering
- Power BI
Data Factory
This experience helps you in the Dataflow Gen 2 experience in the work with generating the data flow and making the nessesary changes to the data structure and content.
This help can be element like help you generate new transformation steps to your data flow, by typing in what you want in the prompt and the Copilot will help you with the task.
It can also help you with a summary of the steps already made to the Dataflow - giving you an overview in plain text of what is happening with the data in all the steps.
If you need sample data in the flow, Copilot also got your back. Just ask for it in the prompt and Copilot delivers.
Data Science
This experience is actually the same as in Data Engineering, this is why I said that we only get 3 Copilot experiences in Fabric instead of 4. So here - go ahead at let me add the Data Engineering icon here also.
This service is an very interesting addin to the Fabric service, as it sits on top of your Notebooks and can help you all different types of tasks. These tasks are listed below and can also be found on Microsofts Learn portal for Copilot in Fabric.
- Chart creation
- Filtering data
- Transformations
- Machine Learning models
The Copilot service can be used in two different approaches. Either through the standard prompt to the right of the Notebook, or, and now it gets interesting, directly in a cell in the Notebook by calling either of the four cell-magcis: %%chat, %%add_comments, %%fix_errors or %%describe.
Enable the cell magics
For you to use the new cell magics, you need to enable the feature by running a specific codecell in the Notebook. But don’t worry, Copilot is here to help again. Just hit the “Get started” button in the chat panel to the right side of the Notebook, and the cell will be generated for you.
Once the code has finished running (it took around 2 mins for me when testing this feature), you will see alot of status messages with libraries being enables and a long desctiption on how to use the Copilot directly in a Notebook cell.
After you have read all the instructions and got a hold of what is happening, you are ready to begin using the cell magics and Copilot.
%%chat
The chat magic gives you the ability to get help on generating code, ask questions to the current state of a Notebook and help you build data manipulation and visualization.
%%add_comments
Perhaps a bit self-explanatory - this help you to add decriptive comments to your Notebook to help other people understand what is happening and how to read the cells behaviour.
%%fix_errors
Fis those errors - if you encounter any error in your Notebook, this magic got your back.
%%decribe
Provides summaries and descriptions to your code. What is happening, why is this working as it does and how to I understand the entire Notebooks final output and delivery.
Power BI
The Power BI Copilot feature is a two part deal.
On one side you can get help to create a report by using a prompt and a ready semantic model in Fabric.
On the other side you can get a Narrative visual in a report, to help write comments and descriptions to the current state and metrics of a report.
Create a report
The Copilot in Fabric can help you create a Power BI report with the use of a prompt.
The prompt is standard OpenAI prompt and give you the ability to write what you want. In the release video of Copilot for Fabric it is stated that you can also make the report look like the corporate visual identity for your specific organisation. This feature, among others, are not yet available in the Copilot for Fabric.
The amount of time after you entered the text in the prompt and the report is generated might take some time to render. During this time, the service is collecting the metadata of your semantic model and processing that to build your report.
Don’t be scared of Microsoft stealing your metadata and semantic models, no data is stored or saved on Microsoft servers after the service has processed the request and returned the results to you.
Above is an example of a report made with Copilot.
The narrative in Power BI- auto comment your reports
The OpenAI / Copilot service in Power BI alsoo gives you a new narrative feature as a visual in Power BI. This visual will help you write comments and content based text narratives directly in your Power BI reports. The results here will be based on the current filter context of the report.
The narrative will also update with people are changing the filtering in the report. The end user needs to click the “update narrative” button in Power BI to get an updated content in the visual.
The prompt for the narrative service is well known as it looks like every other OpenAI chat prompt.
Write the needed output in the prompt. You can also choose the language to use (formal, informal, as a priate etc.) and specify how the output should be - in list form, as a poem, using emojies etc.
Cost perspectives
The Fabric Copilot comes with a cost.
As stated in this blogpost from Microsoft, the service uses the token approach to figure out the cost of the service.
Fabric capacities are based on compute seconds (CU) - and 1.000 tokens in fabric will cost you 400 CU seconds for the input (the text you write in the prompt) and 1.200 CU seconds for the output (the results that comes from the Copilot).
But what is a token, and how many do I need?
This is a great question and the answer is not at all easy to write. On average 1.000 tokens is around 750 words (on both input and output).
☕