It’s downing a bit slowly on me how awesome the direct retrieval of DMVs in PowerBI and PowerQuery actually is. Just see how easy we can build a cool view of our memory consumption in PowerBI:
Left: Tables – Right: Columns
Filter a table:
Just copy this code and paste it into the advanced editor: MCodeDMVMemory.txt
DAXers dream: Combine your DMVs on multiple columns 🙂
Things to watch for:
- The query retrieves the name of the current user by referencing C:\Users in the second step (“CurrentUser”). You might have to adjust that folder to your settings.
- Make sure that you only have one pbix-file open, as only one instance ID will be fetched and you cannot influence which one that will be. So if you just keep one file open, that will be it.
- You might get a warning on privacy levels. Either set them to public, ignore them or adjust the code like Ken Puls has described.
If you experience RAM-problems already, make sure you didn’t fell into this trap.
Enjoy & stay queryious 😉