![Using-Dynamic-Management-Views-DMV-In-DAX-Studio-Enterprise-DNA.png](https://quantinsightsnetwork.com/wp-content/uploads/2024/01/Using-Dynamic-Management-Views-DMV-In-DAX-Studio-Enterprise-DNA-678x381.png)
In this tutorial, you’ll learn about Dynamic Management Views (DMV) in DAX Studio and how to use them to directly load datasets in Power BI.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/10/GIF-BTN-2-1-1024x133.gif)
A Dynamic Management View or DMV returns server information which you can use to monitor the health of a Power BI server and diagnose any problems that may occur.
This tutorial will be using the DAX Studio Masterclass sample report file.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/1_dynamic-management-views.png)
Extracting Data From Dynamic Management Views
First, you need to extract the entire code of an existing file to a new Power BI data model. To do so, open the existing Power BI file in DAX Studio to identify and copy the port number.
Once done, go back to the new Power BI file. Under the Home tab, click the Get data option and select Analysis Services.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/2_dynamic-management-views.png)
In the database wizard, enter the port number in the Server textbox.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/3_dynamic-management-views.png)
For the Database entry, you can get it by executing the DMV below. The results give a Catalog Name which shows the ID of the data model.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/4_dynamic-management-views-1024x293.png)
To load the data, you need to change the option to Import. In the DAX query box, paste another DMV for the measures.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/5_dynamic-management-views.png)
Once done, click OK and then Connect. You can see that you’re able to load the result of the DMV in Power BI.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/6_dynamic-management-views.png)
Before loading this data, you need to filter it out so that you’ll only load the columns you need. Click the Transform Data option.
In the Power Query Editor, you can choose which columns to retain or remove. To do this, click the Choose Columns option under the Home tab. Then, check the column names you need.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/7_dynamic-management-views-1024x570.png)
Afterwards, you can see that by simply using a DMV, you’re able to extract the content of a data model inside another Power BI file.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/8_dynamic-management-views-1024x610.png)
Creating Measures Using Dynamic Management Views
If you want to get information for another table in your data model, you only need to change the DMV and run it against the database.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/9_dynamic-management-views-1024x177.png)
If you’re asked permission to run the native database, click Edit Permission and then Run. Once the table loads, you’ll see that you now have the data of another table in your data model.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/10_dynamic-management-views-1024x477.png)
However, if you click the next step in the Applied Steps pane, you’ll see that it doesn’t work. This is because it’s referencing the columns of a different query. Click X to remove it.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/11_dynamic-management-views-1024x208.png)
To fix this, you need to find the DMV of the relationships table in DAX Studio.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/12_dynamic-management-views-1024x487.png)
Copy this code and paste it in your measure in Power BI. You’ll see that you’re able to view the details regarding the relationships that exists between the tables in your data model.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/13_dynamic-management-views-1024x489.png)
Using Parameters
Instead of manually changing the DMV in each query, you can apply a parameter.
Using a parameter allows you to store information and then use the shared expression to run multiple queries. You can modify the content of a parameter without having the need to go through each query and manually change the DMV.
To create a parameter in Power BI, go to the Home tab and click Manage Parameters.
Let’s create a parameter for the Port Number and the Database. Assign each parameter with a name and select its value Type. In this case, they’re both Texts. For the Current Value, paste the port number in the PortNumber parameter, and the database ID in the DatabaseName parameter.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/14_dynamic-management-views.png)
Once done, you can now use these parameters to reference the port number and database name inside the queries.
![Dynamic Management Views](https://blog.enterprisedna.co/wp-content/uploads/2022/11/15_dynamic-management-views-1024x488.png)
Loading The Final Data
After you’ve made the necessary changes to the dataset in your table, you can now load it inside the data model in Power BI by clicking the Close & Apply option.
![](https://blog.enterprisedna.co/wp-content/uploads/2022/11/16_dynamic-management-views-1024x145.png)
You’ve now successfully loaded the results of each DMV directly to Power BI.
It’s recommended to periodically refresh the data model to continuously gather useful information from the Power BI file through the extracted data in the DMVs.
***** Related Links *****
Connect DAX Studio To Power BI And SSAS
DAX Query Structure In Power BI – Two Engines & DAX Studio
What Is DAX Studio In Power BI Desktop
Conclusion
To summarize, Dynamic Management Views can be used to load datasets from DAX Studio to Power BI. They can be used to create queries and measures.
Dynamic Management Views provide a common mechanism to extract data from any SQL database. Other than using it to connect datasets between programs, it’s more often used for troubleshooting and performance monitoring.
All the best,
Enterprise DNA Experts
Be the first to comment