Compare DAX and M formulas in Visual Studio Code
Compare DAX and M formulas in Visual Studio Code is really easy with the help of Power BI Sidetools.
As it is possible to transfer DAX and M formulas from Power BI desktop to files and to open them in Visual Studio Code, it is possible to compare two files. That’s extremely useful in many cases.
Have a look at this blog post about Power BI Sidetools and download it in the ‘Setup’ chapter : https://thebipower.fr/index.php/power-bi-sidetools/
Step 1 : Select files in Visual Studio Code explorer
In the explorer window, right click on a file
Then click on ‘Select for compare’
In the explorer window, right click on another file and click on ‘Compare with selected’
Step 2 : Compare files
Files are opened next to each other . You will notice differences are coloured. Plus or minus signs appear next to the line numbers. You can still modify files.
On the top right of VS Code window, two arrows allow you to navigate through differences
Conclusion
Comparing formulas can be really usefull and really easy using Visual Studio Code.
Watch this video from Code 2020 for few more tips :
Several Visual Studio Code extensions provide also compare tools.
You may check “Compare folders” from MoshFeu : https://marketplace.visualstudio.com/items?itemName=moshfeu.compare-folders
Please stay tuned to discover more functionalities coming soon. You may subscribe to be aware of new content clicking here.
Custom analyser
With ‘Custom analyser’ feature, Power BI Sidetools users can use external tools built by the…
DAX debugger in Power BI Sidetools
DAX debugger is meant to help Power BI report developers displaying sample data from a…
Manage your external tools easily with Power BI Sidetools
Since the Power BI team allowed to launch external tools from the Power BI desktop…
Easily export to Excel with Power BI Sidetools
While working in Power BI desktop, we often need to export to Excel some data…
Powerful text and file search in Visual Studio Code
As Power BI Sidetools creates files from your report, you are able to search through…
This looks extremely useful.
However, I don’t seem to have much luck with using Power BI Sidetools on my PBIX (which has measures) but is Live Connected to a back-end PBIX. If I wanted to compare measures, I would think that this does not matter. I do have the “Store datasets using enhanced metadata format” selected.
Can you advise if this should be working and it’s a problem between the chair and the keyboard?
Thanks
Hello Stephen,
I didn’t check this configuration yet. Could you provide simple pbix files to allow me to correct the issue?
Thanks for the feedback !
Very very useful tool indeed, that will allow to store in git or any control version system all the formulas in text format (comparable between versions) instead of saving the binary, unreadable pbix file…
Much appreciated !
Looking forward to being able to modify code “live” in VS and reimport it in PBI Desktop to see changes.
Thank you Aurelien,
I worked already on the Files to PBI transfer and that works. As soon as a file is saved, it can be transfered automatically to the desktop. The problem is writing to the desktop is supported by Microsoft only for measures at the moment. Stay tuned