I was editing using the Power Query editor in an Analysis Services project, hosted in Visual Studio 2019. When I tried to use "Add column by example", I received the error shown above:
Could not load file or assembly 'Microsoft.DataIntegration.TransformDataByExample, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad34e35' or one of its dependencies. The system cannot find the file specified.
The problem is that the assembly had not been deployed with the Analysis Services Designer.
Fortunately, the same assembly is used by Power BI Desktop. Because I had that installed on the same machine, I was able to copy the assembly:
from the folder:
C:\Program Files\Microsoft Power BI Desktop\bin
to the same folder as the devenv.exe program from VS 2019:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\
If that path doesn't exist on your machine, it might be here instead if you're using the Community edition:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\
After that, it was back working again. I hope that helps someone else.