DAX Query View?! It now has Copilot not but what is it?
Gus Frazer
Senior Analytics Solutions Engineer at Salesforce | Tableau | Author | ex-Microsoft
Have you noticed this little icon appearing in Power BI desktop and now your scratching your head as to when, why or how to use this?
As Power BI aficionados, we know that diving deep into DAX formulas can sometimes feel like exploring uncharted territory unless you're an Italian genius.
Many of us have spent time creating measures that when we put into a visual, simply didn't work the way we wanted.
Then begin our battle of going back tweaking the DAX formula slightly, then returning to the visual and see if its working how we wanted... In some cases we have then forgotten to remove that testing page and published a dashboard with "Page 5" added to the end by accident... Come on we've all done it!
But fear not, because with the introduction of the DAX query view, navigating through Data Analysis Expressions just got a whole lot easier.
Here's why this new feature is an absolute game-changer:
Now Microsoft have added Copilot to the DAX Query View! So what does this mean?!
Well like with Fabric Data Factory, you can now have Copilot help you build your DAX or even better offer suggestions to refine your DAX!
Here's an example of it at work..
Lets say I need to work out a different currency for my sales measure...
But I don't have the exchange rates in my data...
Could I just ask Copilot to help with this???
Sure!!
Copilot has been able to retrieve the exchange rate and then create a measure which calculates this.
Amazing!
However there are some things to be cautious of here when using Copilot to get you data to be used in a measure like this. Copilot doesn't specify where it went to get that number of 1.36, which can open up data quality issues.
At the time of writing this, the exchange rate of USD to GBP is 1.26.
领英推荐
The exchange rate hasn't been 1.36 since 2022 so perhaps its picking it up from an old rate on the web.
There are some great ways you can leverage Copilot to help you build better and smarter for example to optimize queries.
Let take an example.. in the below you can see I have made a simple DAX formula to work out YoY.
Now I can ask Copilot to optimize this DAX to see how It suggests I improve this..
As you can see it has provided a comparison which allows me to view the changes its suggesting I make to improve the formula. It then provides me with the option to keep the changes or not. Important to note that because I am doing this in Query View, its not actually changing or affecting the measures which are being used in visuals etc.
This is great... but is it the most optimized?
Well I'll ask it again.. And you can see below that is has optimized this again by introducing the Divide function.
Another great example of how Copilot can be used is to actually provide a description of what the DAX formula is trying to do.. Here's an example using the above optimized query..
Now this I think is a great feature to be able to understand what is happening. Great for when you're learning DAX but also great for when you have inherited some work from someone and your trying to understand what they have built!
As you can see, Copilot does some great work to assist us in writing and understanding DAX but I'd be cautious letting it write all your formulas for you. Learning DAX is still the recommended route as you will be better equipped to understand or find errors when they occur.
Hopefully that is useful to provide you with an snapshot of Query View and how Copilot will help you when using it.!
I'd love to hear about how others have been using this feature in practice!