Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

DidierTerrien

Compare DAX and M formulas in Visual Studio Code

image-5

 

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

 

In the explorer window, right click on a file

image

 

Then click on ‘Select for compare’

image-1

 

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

image-2

 

Step 2 : Compare files

 

image-5

 

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

image-4

 

Conclusion

Comparing formulas can be really usefull and really easy using Visual Studio Code.
Watch this video from Code 2020 for few more tips :   https://youtu.be/FvWQzNbWGQk 

 

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

Look at the original blog post in The BI Power website an eventually subscribe for more content :   https://thebipower.fr/index.php/2020/09/02/compare-dax-and-m-formulas-in-visual-studio-code/ 

Comments