<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tabular Models &#8211; DataMartIn</title>
	<atom:link href="https://datamartin.ca/category/tabular-models/feed/" rel="self" type="application/rss+xml" />
	<link>https://datamartin.ca</link>
	<description>We Know Data</description>
	<lastBuildDate>Tue, 30 Jul 2024 13:22:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>What are the DMVs and how you can use them?</title>
		<link>https://datamartin.ca/2022/09/30/what-are-the-dmvs-and-how-you-can-use-them/</link>
		
		<dc:creator><![CDATA[Nuric Ugarte]]></dc:creator>
		<pubDate>Fri, 30 Sep 2022 16:27:12 +0000</pubDate>
				<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[Tabular Models]]></category>
		<category><![CDATA[DMV]]></category>
		<guid isPermaLink="false">https://site1668528124.mywhc.ca/?p=517</guid>

					<description><![CDATA[The DMVs are queries that allow you to retrieve valuable metadata information about your data model, server operations, and server health. What are the DMVs The DMVs queries are an interface to schema rowsets based on SQL and use a SELECT statement and the $System schema with an XML/A schema rowset, however, they do not support the full syntax of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The DMVs are queries that allow you to retrieve valuable metadata information about your data model, server operations, and server health.</p>
<p><strong>What are the DMVs</strong></p>
<p>The DMVs queries are an interface to schema rowsets based on SQL and use a SELECT statement and the $System schema with an XML/A schema rowset, however, they do not support the full syntax of a SELECT statement as: JOIN, GROUP BY, LIKE, CAST, and CONVERT.</p>
<p>Apply to: SQL Server Analysis Services, Azure Analysis Services, Power BI Desktop and Power BI Premium</p>
<p>Example of a DMV query:</p>
<p>SELECT * FROM $System.DISCOVER_CALC_DEPENDENCY</p>
<p>WHERE OBJECT_TYPE = &#8216;MEASURE&#8217;</p>
<p>ORDER BY TABLE ASC</p>
<p>For more information visit the official documentation: <a href="https://docs.microsoft.com/en-us/analysis-services/instances/use-dynamic-management-views-dmvs-to-monitor-analysis-services?view=asallproducts-allversions">https://docs.microsoft.com/en-us/analysis-services/instances/use-dynamic-management-views-dmvs-to-monitor-analysis-services?view=asallproducts-allversions</a></p>
<h3><strong>What are they for?</strong></h3>
<ul>
<li>The DMVs provide information about the active sessions and connections, objects that consume the most CPU or memory at a specific point in time, such as:</li>
</ul>
<table style="border-collapse: collapse;width: 100%" border="1">
<tbody>
<tr>
<td style="width: 24.6792%;text-align: center" width="228"><strong>DMV</strong></td>
<td style="width: 75.2221%;text-align: center" width="396"><strong>Description</strong></td>
</tr>
<tr>
<td style="width: 24.6792%" width="228">$system.discover_commands</td>
<td style="width: 75.2221%" width="396">Provides resource usage and activity information about the currently executing or last executed commands in the opened connections on the server.</td>
</tr>
<tr>
<td style="width: 24.6792%" width="228">$system.discover_sessions</td>
<td style="width: 75.2221%" width="396">This query reports on active sessions, including session user and duration.</td>
</tr>
<tr>
<td style="width: 24.6792%" width="228">$system.discover_connections</td>
<td style="width: 75.2221%" width="396">List the currently opened connections on the server.</td>
</tr>
<tr>
<td style="width: 24.6792%" width="228">$system.discover_memoryusage</td>
<td style="width: 75.2221%" width="396">Lists all memory consumption by object. Most information here: <a href="https://www.kasperonbi.com/new-ssas-memory-usage-report-using-power-bi/">https://www.kasperonbi.com/new-ssas-memory-usage-report-using-power-bi/</a></td>
</tr>
</tbody>
</table>
<ul>
<li>To document your Power BI or SSAS data model, the main queries DMVs available for model documentation are:</li>
</ul>
<ul>
<li style="list-style-type: none">
<ul style="list-style-type: circle">
<li><strong>TMSCHEMA_TABLES:</strong> List the Column objects in each table.</li>
<li><strong>TMSCHEMA_COLUMNS: </strong>List the Columns objects in each table.</li>
<li><strong>TMSCHEMA_MEASURES: </strong>List the Measure objects in each table.</li>
<li><strong>TMSCHEMA_RELATIONSHIPS:</strong> List the Relationship objects in the model.</li>
<li><strong>TMSCHEMA_ROLES:</strong> Shows information about the Role objects in the model.</li>
<li><strong>TMSCHEMA_PARTITIONS:</strong> Provides information about the Partition objects in each table.</li>
</ul>
</li>
</ul>
<p>In the past I used to create my own documenters using the DMVs, but I recently discovered the excellent and very complete tool “Model Documenter” created by Marc Lelijveld (MVP).</p>
<p>This tool generates the documentation about your data model in an easy and quick way, you can get more information and download the tool in the page: <a href="https://data-marc.com/model-documenter/">https://data-marc.com/model-documenter/</a></p>
<p><strong> </strong></p>
<p><strong>DISCOVER_CALC_DEPENDENCY</strong></p>
<p>With this DMV you can obtain the list of the dependencies among the objects in your model and extract the DAX expressions. This allows you to have more control over your data models as you can measure the impact of modify or remove any object.</p>
<p>I created the tool <u>“Tabular model cleaner”</u> using this DMV, which helps you to obtain all the dependences of the data model in an efficient and automated way and the usability of the model objects in the reports connected to the Power BI or SSAS Data model.</p>
<p>For more information visit: <u>Tabular model cleaner</u></p>
<p><strong> </strong></p>
<p><strong>How to run the DMVs</strong></p>
<p><strong>1. DAX Studio:</strong> Open the Power BI Dataset that you want to document. Open DAX Studio and choose the “PBI / SSDT Model” data source option, then click on Connect:</p>
<p><img decoding="async" class="wp-image-518 aligncenter" src="/wp-content/uploads/2022/09/dax-300x165.jpg" alt="" width="509" height="280" srcset="https://datamartin.ca/wp-content/uploads/2022/09/dax-300x165.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/dax-768x421.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/dax.jpg 964w" sizes="(max-width: 509px) 100vw, 509px" /></p>
<p>If you have Power BI Premium you can connect to the dataset, to do this select the workspace, go to “Workspace settings” and copy the Workspace Connection and paste it into the “Tabular Server” option in the DAX Studio.</p>
<p><img decoding="async" class="wp-image-519 aligncenter" src="/wp-content/uploads/2022/09/workspace-300x273.jpg" alt="" width="497" height="452" srcset="https://datamartin.ca/wp-content/uploads/2022/09/workspace-300x273.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/workspace.jpg 766w" sizes="(max-width: 497px) 100vw, 497px" /></p>
<p>Go to DMV pane and click on the query you want consult:</p>
<p><img decoding="async" class="wp-image-520 aligncenter" src="/wp-content/uploads/2022/09/daxstudio2-290x300.jpg" alt="" width="503" height="520" srcset="https://datamartin.ca/wp-content/uploads/2022/09/daxstudio2-290x300.jpg 290w, https://datamartin.ca/wp-content/uploads/2022/09/daxstudio2.jpg 690w" sizes="(max-width: 503px) 100vw, 503px" /></p>
<p><strong>2. From Power BI Desktop: </strong>You can run DMVs queries from DAX Studio but that will return you a table with the data, you should connect to the DMVs using Power BI, to view and analyze the information more easily.</p>
<p>&#8211; Open Power BI Desktop.</p>
<p>&#8211; Choose the “SQL Server Analysis Services database” source.</p>
<p>&#8211; Include the Server and Database.</p>
<p><img decoding="async" class="wp-image-521 aligncenter" src="/wp-content/uploads/2022/09/ssas-300x204.jpg" alt="" width="728" height="495" srcset="https://datamartin.ca/wp-content/uploads/2022/09/ssas-300x204.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/ssas.jpg 749w" sizes="(max-width: 728px) 100vw, 728px" /></p>
<p>Consider if you are connected to a local data model, the database name will change every time you open the Power BI Desktop file, so you will have to edit the connection parameter when you need to refresh the data.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Essential checklist to keep your Power BI Solutions optimized. Part II. Data model good practices</title>
		<link>https://datamartin.ca/2022/09/29/essential-checklist-to-keep-your-power-bi-solutions-optimized-part-ii-data-model-good-practices/</link>
		
		<dc:creator><![CDATA[Nuric Ugarte]]></dc:creator>
		<pubDate>Thu, 29 Sep 2022 14:37:23 +0000</pubDate>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[Tabular Models]]></category>
		<guid isPermaLink="false">https://site1668528124.mywhc.ca/?p=420</guid>

					<description><![CDATA[This second article is focused on best practices for designing your data model, optimizing CPU, RAM, and workspace capacity consumption by minimizing memory usage. Benefits. Reduce space and processing time. Faster refresh times. Lower latency reports. Reduce the time development. More user-friendly data models because the user will not navigate through a bunch of useless [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This second article is focused on best practices for designing your data model, optimizing CPU, RAM, and workspace capacity consumption by minimizing memory usage.</p>
<p><strong>Benefits</strong>.</p>
<ul>
<li>Reduce space and processing time.</li>
<li>Faster refresh times.</li>
<li>Lower latency reports.</li>
<li>Reduce the time development.</li>
<li>More user-friendly data models because the user will not navigate through a bunch of useless objects that are not needed to build the reports.</li>
</ul>
<p><strong>&#8211; Choose the appropriate dataset mode for your solution:</strong> You can use Import, DirectQuery, and Composite model.</p>
<p>There are a variety of factors to consider when deciding which method to use, so I recommend that you review the advantages, disadvantages, and limitations of each in the <a href="https://docs.microsoft.com/en-us/power-bi/connect-data/service-dataset-modes-understand">Microsoft documentation</a> so that you can select the correct one.</p>
<p><strong>&#8211; Build your data model using a <u>star schema</u></strong> architecture avoiding snowflake schema:</p>
<p><strong>Benefits</strong></p>
<ul>
<li>More user friendly.</li>
<li>The DAX formulas are simpler.</li>
<li>The time refreshes are faster.</li>
<li>Reduces redundant data</li>
</ul>
<p>Star schema are specialized data models used when designing data warehouses, the tables are classified as either dimension or fact. In this schema the fact sits in the middle and the dimensions are all around related directly to the fact which gives it the shape of a star.</p>
<p><strong><img decoding="async" class="wp-image-592 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/star-schema-300x221.jpg" alt="" width="624" height="460" srcset="https://datamartin.ca/wp-content/uploads/2022/09/star-schema-300x221.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/star-schema.jpg 756w" sizes="(max-width: 624px) 100vw, 624px" /></strong></p>
<p><strong>&#8211; Only include the essential columns </strong><strong>to create the reports:</strong> You do not want a report larger than necessary. However, removing the unnecessary columns could be too complicated when you have a lot of reports connected to the dataset because they can break.</p>
<p>I created a tool to help you to clean up your data models easily and quickly, you can download it for free, visit the link: <u><a href="https://datamartin.ca/2022/09/18/data-model-cleaner-for-power-bi-and-analysis-services-ssas/">Tabular model cleane</a>r</u>.</p>
<p><strong><img decoding="async" class="wp-image-593 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-300x105.jpg" alt="" width="626" height="219" srcset="https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-300x105.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1024x359.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-768x270.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects.jpg 1114w" sizes="(max-width: 626px) 100vw, 626px" /></strong></p>
<p><strong>&#8211; Load in your data model the necessary tables</strong>: Probably you need to import a table in Power Query to make intermediate calculations but if you won&#8217;t use this table in your reports remember unchecking the &#8220;enable load&#8221; option in Power Query:</p>
<p><strong><img decoding="async" class="wp-image-594 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/load-300x266.jpg" alt="" width="287" height="255" srcset="https://datamartin.ca/wp-content/uploads/2022/09/load-300x266.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/load.jpg 312w" sizes="(max-width: 287px) 100vw, 287px" /></strong></p>
<p><strong>&#8211; Apply an <a href="https://datamartin.ca/2022/09/29/step-by-step-instructions-to-configure-incremental-refresh/"><u>Incremental Refresh</u></a> policy to reduce the amount of data: </strong>Power BI desktop is limited for your computer resources, if you are working with very large models will be necessary configure the Incremental refresh.</p>
<p><strong>Benefits</strong></p>
<ul>
<li>Optimize your time development because you work over a smaller data model.</li>
<li>Shorter data refresh time.</li>
<li>Lower resource consumption in the Power BI Service.</li>
</ul>
<p>Check our article: <a href="https://datamartin.ca/2022/09/29/step-by-step-instructions-to-configure-incremental-refresh/"><u>Configure an Incremental Refresh Policy in seven steps</u></a></p>
<p><strong><img decoding="async" class="wp-image-595 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/increm-refresh-post-copy-1-300x199.jpg" alt="" width="481" height="319" srcset="https://datamartin.ca/wp-content/uploads/2022/09/increm-refresh-post-copy-1-300x199.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/increm-refresh-post-copy-1-1024x680.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/increm-refresh-post-copy-1-768x510.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/increm-refresh-post-copy-1.jpg 1148w" sizes="(max-width: 481px) 100vw, 481px" /></strong></p>
<p><strong>&#8211; Group by and summarize combined with composite models:</strong> Depending on the level of granularity that you need to handle in your reports you can group your data by month, division, city for example.</p>
<p>In case you have to visualize a detail of the data, you can create a composite model and adding a drill through page that retrieves the detail data from a DirectQuery table.</p>
<p>For more detail check: <a href="https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-composite-models">Composite Models in Power BI Desktop</a></p>
<p><strong>&#8211; Avoid many-to-many relationships: </strong>Most of the time, this can be avoided by creating a bridge table with unique values and one-to-many relationships from the bridge table to the fact tables, thus adopting star schema.</p>
<p><strong><img decoding="async" class="wp-image-596 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/n-to-n-300x141.jpg" alt="" width="530" height="249" srcset="https://datamartin.ca/wp-content/uploads/2022/09/n-to-n-300x141.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/n-to-n-1024x481.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/n-to-n-768x361.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/n-to-n.jpg 1244w" sizes="(max-width: 530px) 100vw, 530px" /></strong></p>
<p><strong>&#8211; Avoid both-directional relationships in your data model:</strong> You need to have a solid data modeling knowledge to measure the impact of this type of relationship in your data model, otherwise this could cause:</p>
<ul>
<li>Unexpected results</li>
<li>Performance problems</li>
</ul>
<p><img decoding="async" class="wp-image-597 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/many-to-many-300x140.jpg" alt="" width="581" height="271" srcset="https://datamartin.ca/wp-content/uploads/2022/09/many-to-many-300x140.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/many-to-many-1024x478.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/many-to-many-768x358.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/many-to-many.jpg 1159w" sizes="(max-width: 581px) 100vw, 581px" /></p>
<p>Instead of creating a bi-directional relationship, try using a measure like the one below to get the value you need:</p>
<p><img decoding="async" class="wp-image-598 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/cross-filter-300x59.jpg" alt="" width="473" height="93" srcset="https://datamartin.ca/wp-content/uploads/2022/09/cross-filter-300x59.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/cross-filter-768x152.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/cross-filter.jpg 803w" sizes="(max-width: 473px) 100vw, 473px" /></p>
<p>&#8211; Add a <strong>date table</strong> to your model and mark it as a date table.</p>
<p><strong><img decoding="async" class="wp-image-599 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/data-table-300x107.jpg" alt="" width="547" height="195" srcset="https://datamartin.ca/wp-content/uploads/2022/09/data-table-300x107.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/data-table-1024x365.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/data-table-768x274.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/data-table-1536x548.jpg 1536w, https://datamartin.ca/wp-content/uploads/2022/09/data-table.jpg 1571w" sizes="(max-width: 547px) 100vw, 547px" /></strong></p>
<p><strong>&#8211; Disable auto date/time option: </strong>This avoids Power BI automatically create a lot of date dimension tables in the background.</p>
<p><strong><img decoding="async" class="wp-image-600 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/data-time-option-300x287.jpg" alt="" width="443" height="424" srcset="https://datamartin.ca/wp-content/uploads/2022/09/data-time-option-300x287.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/data-time-option.jpg 607w" sizes="(max-width: 443px) 100vw, 443px" /></strong></p>
<p><strong>&#8211; Disable the “Autodetect new relationships after data is loaded” option: </strong>Because you could mess up your data model if you do not have solid experience in data modeling.</p>
<p><strong><img decoding="async" class="wp-image-601 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/autodetect-300x287.jpg" alt="" width="400" height="383" srcset="https://datamartin.ca/wp-content/uploads/2022/09/autodetect-300x287.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/autodetect.jpg 594w" sizes="(max-width: 400px) 100vw, 400px" /></strong></p>
<p><strong>&#8211; Remove columns with high cardinality:</strong> High cardinality columns can be particularly expensive. If possible:</p>
<ul>
<li>Remove columns such as GUID and timestamp from a SQL Server table from your model.</li>
<li>Splitting Datetime columns in two columns, one for date and one for time.</li>
</ul>
<p><strong><img decoding="async" class="wp-image-602 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/dax-studio2-300x95.jpg" alt="" width="692" height="219" srcset="https://datamartin.ca/wp-content/uploads/2022/09/dax-studio2-300x95.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/dax-studio2-1024x326.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/dax-studio2-768x244.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/dax-studio2.jpg 1261w" sizes="(max-width: 692px) 100vw, 692px" /></strong></p>
<p><strong>&#8211; Select the correct data type: </strong>Don’t use decimal type if you only need the whole number or if your data granularity is at day level don’t use Date/Time data.</p>
<p><strong>&#8211; Create measures instead of Calculated Columns:</strong> Using measures where applicable will help reduce data model size and increase the efficiency of the calculations.</p>
<p><strong> </strong><strong>&#8211; Create custom columns in Power query instead of DAX calculated columns:</strong> The custom columns created in Power Query achieve a better and more efficient compression.</p>
<p><strong>&#8211; Use tools as DAX Studio and Bravo </strong><strong>you to analyze where your model consumes the most memory:</strong> and choose which columns and tables you should remove to optimize it.</p>
<p><img decoding="async" class="size-medium wp-image-603 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/tools-300x123.jpg" alt="" width="300" height="123" srcset="https://datamartin.ca/wp-content/uploads/2022/09/tools-300x123.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/tools.jpg 318w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>&#8211; Use the tool <a href="https://datamartin.ca/2022/09/18/data-model-cleaner-for-power-bi-and-analysis-services-ssas/"><u>Tabular model cleaner</u></a> to analyze the impact in your reports of make changes or removing objects from your data models.</p>
<p><img decoding="async" class="wp-image-397 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/main-picture-300x167.jpg" alt="" width="489" height="272" srcset="https://datamartin.ca/wp-content/uploads/2022/09/main-picture-300x167.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/main-picture-1024x569.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/main-picture-768x427.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/main-picture.jpg 1367w" sizes="(max-width: 489px) 100vw, 489px" /></p>
<p>Click <a href="https://datamartin.ca/2022/09/19/essential-checklist-to-keep-your-power-bi-solutions-optimized-part-iii-optimizing-dax-formulas/"><span style="text-decoration: underline;">here</span></a> for part 3 of this series.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data Model Cleaner for Power BI and Analysis Services (SSAS)</title>
		<link>https://datamartin.ca/2022/09/18/data-model-cleaner-for-power-bi-and-analysis-services-ssas/</link>
		
		<dc:creator><![CDATA[Nuric Ugarte]]></dc:creator>
		<pubDate>Sun, 18 Sep 2022 20:32:10 +0000</pubDate>
				<category><![CDATA[Analysis Services]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[Tabular Models]]></category>
		<guid isPermaLink="false">https://site1668528124.mywhc.ca/?p=395</guid>

					<description><![CDATA[Is your data model turning into an unfriendly monster full of unnecessary columns and measures with long refresh time? Or after cleaning up your data model, do you find that connected reports break so you manually go through each one to find the cause? In this post I will introduce you to the first version [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Is your data model turning into an unfriendly monster full of unnecessary columns and measures with long refresh time?</p>
<p>Or after cleaning up your data model, do you find that connected reports break so you manually go through each one to find the cause?</p>
<p>In this post I will introduce you to the first version of a tool I created to help you in the process of clean your data models, which can become a nightmare if you don&#8217;t have an effective and fast way to do it.</p>
<p><strong>Challenge</strong></p>
<p>When developers <span style="text-decoration: underline;">remove unnecessary objects </span>from large data models<span style="text-decoration: underline;">,</span> connected <span style="text-decoration: underline;">reports break</span> a and the <span style="text-decoration: underline;">validation process is manual, tedious and time-consuming.</span></p>
<p><strong>Solution:</strong></p>
<p>When I tried to clean my data models I couldn’t find any tool with all the functionalities I needed, so decided to create my own using Power BI, which allows:</p>
<p>&#8211; Obtain all the dependencies of the data model in an efficient and automated way.</p>
<p>&#8211; Identify the list of objects (measures, columns, calculated columns, tables) in use and those that are not, in the reports connected to the Power BI or SSAS Data model.</p>
<p>I hope it can help you in the process of keeping your data models optimized 😊.</p>
<p><strong>How It Works</strong></p>
<p>This tool contains two parts:</p>
<p><strong>1. Get the dependencies between all objects in the data model:</strong> This tool identifies how all the objects in your data model are connected to each other. For example, if you want to remove a measure, you will be able to detect the impact on your reports.</p>
<p>To get the dependencies I used Dynamic Management Views (DMV) which are queries that return information about model objects, server operations and server status. If you want to know more that DMVs, check our article <a href="https://datamartin.ca/2022/09/30/what-are-the-dmvs-and-how-you-can-use-them/"><u>What are Dynamic Management Views (DMVs) and what are they for?.</u></a></p>
<p>The main DMV that I used is the <a href="/blog/what-are-dynamic-management-views-dmvs-and-what-are-they-for/"><u>DISCOVER_CALC_DEPENDENCY</u></a>, which Returns information about the calculation dependency for an object that is specified in a Tabular database or in a DAX query that is executed against a Tabular database.</p>
<p><strong>2. Identify the objects used in the data model:</strong> For that I used the tool “Report Analyzer” explained in detail in this article:<a href="https://www.elegantbi.com/post/reportanalyzer"> Report Analyzer</a></p>
<p>Finally, I related the information provided for the <a href="https://datamartin.ca/2022/09/30/what-are-the-dmvs-and-how-you-can-use-them/"><u>DMVs</u></a> and I merged it with the information generated for the <a href="https://www.elegantbi.com/post/reportanalyzer"><u>Report Analyzer</u></a> in a Power BI report.</p>
<p><strong>How to Use the Tool</strong></p>
<p>You can use this tool in any Power BI data model with the following simple steps:</p>
<p><strong>1. Get the connection details of a Power BI Dataset</strong></p>
<p><strong>Local Power BI Dataset:</strong></p>
<p>Open a Power BI Dataset that you want to document. Open DAX Studio and choose the “PBI / SSDT Model” data source option, then click on Connect:</p>
<p><img decoding="async" class="wp-image-396 aligncenter" src="/wp-content/uploads/2022/09/connection-300x169.jpg" alt="" width="476" height="268" srcset="https://datamartin.ca/wp-content/uploads/2022/09/connection-300x169.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/connection-1024x576.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/connection-768x432.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/connection.jpg 1220w" sizes="(max-width: 476px) 100vw, 476px" /></p>
<p>In the lower right-hand corner of the screen is the name of the server, and the port number you have connected to. In this case it is localhost:52223</p>
<p><img decoding="async" class=" wp-image-629 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/server-300x44.png" alt="" width="395" height="58" srcset="https://datamartin.ca/wp-content/uploads/2022/09/server-300x44.png 300w, https://datamartin.ca/wp-content/uploads/2022/09/server.png 375w" sizes="(max-width: 395px) 100vw, 395px" /></p>
<p>Run the following DMV query in a DAX query window. This will give you the GUID, the name of the only database in the Power BI data model:</p>
<p>SELECT [CATALOG_NAME] FROM $SYSTEM.DBSCHEMA_CATALOGS</p>
<p><strong><img decoding="async" class="alignnone wp-image-630 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/db-300x120.png" alt="" width="438" height="175" srcset="https://datamartin.ca/wp-content/uploads/2022/09/db-300x120.png 300w, https://datamartin.ca/wp-content/uploads/2022/09/db.png 461w" sizes="(max-width: 438px) 100vw, 438px" /></strong></p>
<p><strong>Power BI Premium</strong></p>
<p><strong>&#8211; Server:</strong> Go to “Workspace settings” and copy the Workspace Connection.</p>
<p><img decoding="async" class="wp-image-631 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/workspace-connection-300x271.jpg" alt="" width="414" height="374" srcset="https://datamartin.ca/wp-content/uploads/2022/09/workspace-connection-300x271.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/workspace-connection.jpg 764w" sizes="(max-width: 414px) 100vw, 414px" /></p>
<p><strong>&#8211; Database:</strong> Is the dataset name.</p>
<p>2. <strong>Update the Dataset parameters in the Data model cleaner tool:</strong></p>
<p><strong><img decoding="async" class="wp-image-632 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/edit-parameters-300x133.jpg" alt="" width="639" height="283" srcset="https://datamartin.ca/wp-content/uploads/2022/09/edit-parameters-300x133.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/edit-parameters.jpg 668w" sizes="(max-width: 639px) 100vw, 639px" /></strong></p>
<p><strong>3. Get all the objects used in the Power BI reports connected to the data model:</strong></p>
<p>&#8211; Save all the PBI report files connected to the golden dataset in a folder.</p>
<p>&#8211; Open External tool: Report Analyzer:</p>
<p><img decoding="async" class="wp-image-633 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-300x51.jpg" alt="" width="535" height="91" srcset="https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-300x51.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer.jpg 593w" sizes="(max-width: 535px) 100vw, 535px" /></p>
<p>&#8211; Click on “Select folder”:</p>
<p><img decoding="async" class="wp-image-634 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-2-300x106.jpg" alt="" width="507" height="179" srcset="https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-2-300x106.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-2.jpg 637w" sizes="(max-width: 507px) 100vw, 507px" /></p>
<p>&#8211; Select the respective folder, and select “Export Report Metadata”:</p>
<p><img decoding="async" class=" wp-image-556 aligncenter" src="/wp-content/uploads/2022/09/performance-analyzer-3-300x141.jpg" alt="" width="492" height="231" srcset="https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-3-300x141.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/performance-analyzer-3.jpg 531w" sizes="(max-width: 492px) 100vw, 492px" /></p>
<p>&#8211; You will see the following message:</p>
<p><img decoding="async" class="wp-image-635 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/message-300x127.jpg" alt="" width="392" height="166" srcset="https://datamartin.ca/wp-content/uploads/2022/09/message-300x127.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/message.jpg 512w" sizes="(max-width: 392px) 100vw, 392px" /></p>
<p>The files in .txt format will be saved in the same folder where the reports are.</p>
<p><strong>4. Update the “LocalSoucePBITemplates” parameter in Power BI:</strong></p>
<p>Type the location of the folder with the .txt files generated by the <a href="https://www.elegantbi.com/post/reportanalyzer"><u>Report Analyzer</u></a>:</p>
<p><strong><img decoding="async" class=" wp-image-700 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/parameters-300x126.jpg" alt="" width="376" height="158" srcset="https://datamartin.ca/wp-content/uploads/2022/09/parameters-300x126.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/parameters-1024x431.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/parameters-768x323.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/parameters.jpg 1081w" sizes="(max-width: 376px) 100vw, 376px" /></strong></p>
<p><strong>Information provided by the Data Model Cleaner</strong><strong> tool</strong></p>
<p><strong>&#8211; Object dependencies:</strong> On this tab you can consult the list of calculated objects affected by the selected object:</p>
<p><strong><img decoding="async" class="wp-image-637 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/dependencies-300x95.jpg" alt="" width="631" height="200" srcset="https://datamartin.ca/wp-content/uploads/2022/09/dependencies-300x95.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/dependencies-1024x326.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/dependencies-768x244.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/dependencies.jpg 1113w" sizes="(max-width: 631px) 100vw, 631px" /></strong></p>
<p><strong>&#8211; Calculated Objects Breakdown: </strong>This tab shows the breakdown of the queried calculated object.</p>
<p><strong><img decoding="async" class="wp-image-639 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/breakdown-300x128.jpg" alt="" width="596" height="254" srcset="https://datamartin.ca/wp-content/uploads/2022/09/breakdown-300x128.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/breakdown-1024x437.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/breakdown-768x328.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/breakdown.jpg 1109w" sizes="(max-width: 596px) 100vw, 596px" /></strong></p>
<p><strong>&#8211; Objects Used / Unused List:</strong> On this tab you can easily consult the Used / Unused list of the objects that will help you make decisions about hiding or removing them from the model.</p>
<p>If you consult by table additionally you will see the “M” or DAX expression of the table.</p>
<p>To determine the used list of objects this tool consider:</p>
<ul>
<li data-leveltext="o" data-font="Courier New" data-listid="14" data-aria-posinset="1" data-aria-level="1">Visuals and custom visuals</li>
<li data-leveltext="o" data-font="Courier New" data-listid="14" data-aria-posinset="2" data-aria-level="1">Report-Level measures</li>
<li data-leveltext="o" data-font="Courier New" data-listid="14" data-aria-posinset="3" data-aria-level="1">Filters added to the visuals, pages, and reports</li>
<li data-leveltext="o" data-font="Courier New" data-listid="14" data-aria-posinset="4" data-aria-level="1">Bookmarks</li>
</ul>
<p><img decoding="async" class="wp-image-640 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1-300x105.jpg" alt="" width="634" height="222" srcset="https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1-300x105.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1-1024x359.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1-768x270.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/used-unused-objects-1.jpg 1114w" sizes="(max-width: 634px) 100vw, 634px" /></p>
<p>You can also drill through on any object used and consult the reports, pages and in which of the visualizations this object is being used:</p>
<p><strong><img decoding="async" class=" wp-image-641 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/drill-menu-300x135.jpg" alt="" width="610" height="275" srcset="https://datamartin.ca/wp-content/uploads/2022/09/drill-menu-300x135.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/drill-menu-1024x460.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/drill-menu-768x345.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/drill-menu.jpg 1102w" sizes="(max-width: 610px) 100vw, 610px" /></strong></p>
<p><strong><img decoding="async" class=" wp-image-642 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/drill-300x80.jpg" alt="" width="627" height="167" srcset="https://datamartin.ca/wp-content/uploads/2022/09/drill-300x80.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/drill-1024x271.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/drill-768x204.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/drill.jpg 1124w" sizes="(max-width: 627px) 100vw, 627px" /></strong></p>
<p><strong>&#8211; Used Objects in the Reports:</strong> List of objects used by report.</p>
<p><img decoding="async" class=" wp-image-643 aligncenter" src="https://datamartin.ca/wp-content/uploads/2022/09/used-objects-300x76.jpg" alt="" width="609" height="154" srcset="https://datamartin.ca/wp-content/uploads/2022/09/used-objects-300x76.jpg 300w, https://datamartin.ca/wp-content/uploads/2022/09/used-objects-1024x261.jpg 1024w, https://datamartin.ca/wp-content/uploads/2022/09/used-objects-768x196.jpg 768w, https://datamartin.ca/wp-content/uploads/2022/09/used-objects.jpg 1331w" sizes="(max-width: 609px) 100vw, 609px" /></p>
<h3 dir="auto" tabindex="-1">Download Tabular Model Cleaner tool here 👇:</h3>
<p dir="auto"><a href="https://github.com/NuricBI/NuricBI/files/10865237/Tabular.Models.Cleaner.tool.zip">Tabular Model Cleaner tool.zip</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
