Visual Studio Code

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.

You may have a look at this blog post about Power BI Sidetools before : https://thebipower.fr/index.php/power-bi-sidetools/

Step 1 : Select files in Visual Studio Code explorer

Visual Studio Code

In the explorer window, right click on a file

Visual Studio Code

Then click on ‘Select for compare’

Visual Studio Code

In the explorer window, right click on another file and click on ‘Compare with selected’

Step 2 : Compare files

Visual Studio Code

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.

Visual Studio Code

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.

2 thoughts on “Compare DAX and M formulas in Visual Studio Code”

  1. 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

    1. 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 !

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.