<?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>Semantic Layer | Capstone Analytics</title>
	<atom:link href="https://capstoneanalytics.com.au/tag/semantic-layer/feed/" rel="self" type="application/rss+xml" />
	<link>https://capstoneanalytics.com.au</link>
	<description>Analytics Simplified</description>
	<lastBuildDate>Mon, 30 Jan 2023 10:48:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Musings from developing and deploying enterprise grade semantic models &#8211; Part 3: Technical learnings</title>
		<link>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part3-technical-learnings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=musings-from-developing-and-deploying-enterprise-grade-semantic-models-part3-technical-learnings</link>
					<comments>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part3-technical-learnings/#respond</comments>
		
		<dc:creator><![CDATA[Abhijith DSouza]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 10:43:33 +0000</pubDate>
				<category><![CDATA[Power BI]]></category>
		<category><![CDATA[DAX]]></category>
		<category><![CDATA[Enterprise Semantic Model]]></category>
		<category><![CDATA[Semantic Layer]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">https://capstoneanalytics.com.au/?p=2888</guid>

					<description><![CDATA[In Part 1 of this series we introduced the concept of enterprise grade semantic models and in Part 2 we discussed some general learnings from developing and deploying enterprise grade semantic models. In Part 3 we will discuss the technical learnings. You won&#8217;t find a treatise on how to do each thing in detail but [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In <a href="https://capstoneanalytics.com.au/learnings-from-developing-enterprise-grade-semantic-models/">Part 1</a> of this series we introduced the concept of enterprise grade semantic models and in <a href="https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings/">Part 2</a> we discussed some general learnings from developing and deploying enterprise grade semantic models. In Part 3 we will discuss the technical learnings. You won&#8217;t find a treatise on how to do each thing in detail but hopefully there is enough content in here to start thinking about applying some of these learnings in your project.</p>
<p>The learnings are divided into 4 sections: IMPORT, MODEL, REFRESH, SUPPORT. These correspond to roughly the four main tasks of a semantic modeller.</p>
<h3>IMPORT</h3>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Apply transformations as left as possible</h5>
<p>All reusable logic needs to be shifted as left as possible and as close to the source as practical. This is to ensure that the databases do all the heavy lifting (extract, transform and load) and your semantic model becomes a layer to aggregate the metrics via measures rather than an ETL layer. This diagram from Part 1 shows where the various transformations and measures are defined</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2943" src="https://capstoneanalytics.com.au/wp-content/uploads/2022/10/Picture1.png" alt="" width="3922" height="1468" srcset="https://capstoneanalytics.com.au/wp-content/uploads/2022/10/Picture1.png 3922w, https://capstoneanalytics.com.au/wp-content/uploads/2022/10/Picture1-1280x479.png 1280w, https://capstoneanalytics.com.au/wp-content/uploads/2022/10/Picture1-980x367.png 980w, https://capstoneanalytics.com.au/wp-content/uploads/2022/10/Picture1-480x180.png 480w" sizes="(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) and (max-width: 1280px) 1280px, (min-width: 1281px) 3922px, 100vw" /></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Star schema model is preferred</h5>
<p>A star schema is the best technique for faster reports and lesser memory consumption. An enterprise model may have multiple star schemas in the same model, with fact tables linked to conformed dimensions. This is the first step in getting the semantic model right. If it is not star schema, performance will suffer.</p>
<p><img decoding="async" class="" src="https://learn.microsoft.com/en-us/power-bi/guidance/media/star-schema/star-schema-example2.png" alt="Understand star schema and the importance for Power BI - Power BI | Microsoft Learn" width="853" height="602" /><br />
<em>Image source</em>: <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fpower-bi%2Fguidance%2Fstar-schema&amp;psig=AOvVaw0P2Kug0_YtWEU5ifQo12gp&amp;ust=1675072384929000&amp;source=images&amp;cd=vfe&amp;ved=0CA8QjRxqFwoTCPi02oXB7PwCFQAAAAAdAAAAABAE">MS Learn</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Use views instead of tables</h5>
<p>Use views to import data into your Power BI model. Using views has three advantages<br />
1. Tables generally do not contain business friendly names. They might have a name such as MemberAccountBalance_Total which is not user friendly. You can write this in a view as Member Account Balance.<br />
2. You can remove/add columns in views. Tables often contain columns such as Record_From_Date, Record_To_Date etc which are required for testing purposes but are not required in the semantic model. So you can remove such columns in the views. You can also add new columns in the views. These are commonly report level logic which are specific to certain reports. So if you want to bin your data, you can write that logic in the views.<br />
3. You can join multiple tables in views. Sometimes the views are not straight forward and you might want to join multiple tables to form one view to meet the reporting requirements.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Simplify views &#8211; resulting in simpler DAX</h5>
<p>Simplify views as much as possible so that the DAX becomes simpler, and the queries perform faster. The goal of the semantic model is not to show off your DAX, in fact it is the exact opposite. The semantic model should only contain simple aggregations like SUM, DISTINCTCOUNT, AVERAGE and/or simple filters in CALCULATE. If you are traversing multiple tables with DAX then it&#8217;s too complex. Move the logic back to the tables/views so that the DAX is simplified.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Do not import all data into desktop</h5>
<p>This is the key to making your model lighter in desktop and faster to publish. A model I&#8217;m currently working on is ~12GB in Power BI service (memory) while it only occupies 4MB of disk space on my laptop. How is it even possible? The trick is to only import a fraction of the data into your desktop model. You can either import only 1000 rows for each table and/or use a &#8216;Start Date&#8217; parameter to only import from a certain date onwards. Use parameters to achieve this as explained below.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Parameterize everything</h5>
<p>Use parameters in Power Query. Parameters can be used to store server name, database name, schema name, Start Date. A typical parameter can look like this:</p>
<p><img decoding="async" src="https://mail.google.com/mail/u/0?ui=2&amp;ik=bcae2b5ab2&amp;attid=0.1&amp;permmsgid=msg-a:r1347536324243995491&amp;th=1860074a037328c7&amp;view=fimg&amp;fur=ip&amp;sz=s0-l75-ft&amp;attbid=ANGjdJ-nhtobk4XwObKHVXD5cuCWaHoPTUC77KD2-lKG4FUIXBdAv0e7ImGDO6Px2JuVo0KAcGc6AelcCQTFioy0AzV3yuFqwiDLV_f7XjfjwfpSgYUJ-8J3mQrcHJg&amp;disp=emb&amp;realattid=ii_ldi6bmem0" alt="image.png" /></p>
<p>The advantage of using parameters are twofold:<br />
1. You can have different names for servers, databases in different environments. This is crucial as you would publish your model to a UAT/SIT environment first and then push it to production. And normally non prod environments have a different set of servers and databases<br />
2. You can quickly change names of servers, databases, schemas if they are renamed at the source. Without parameters you would have to manually go to each query and change it, which would be time consuming.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Utilise query folding in power query</h5>
<p>One of the core principles of an enterprise model is that all columns have to be defined in the views and not in Power BI. However, you can certainly remove some columns in Power Query which you may not want to import into your model. An example would be fact table primary keys. These keys are normally created for testing purposes but don&#8217;t serve a modelling or reporting purpose. So, you can remove them in Power Query. Another step you might apply in power query is a filtering step to limit the rows being imported. Ensure that these two steps still utilise query folding (from my experience they should)</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<h3>MODEL</h3>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Use desktop for DEV</h5>
<p>Since you are only bringing in a fraction of the data into the desktop model, it cannot be used to test the data. Use it as a development (DEV) workspace where you apply all column and DAX formatting, table naming, column ordering etc. Since its a lighter model you can easily push the changes to UAT/SIT workspace with the use of external tools (see Use External Tools section).</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Give descriptions for tables and fields</h5>
<p>It&#8217;s not just important to import all the data and write good DAX it is also important to provide descriptions to all entities used by the business users in the model (tables, columns, measures, hierarchy) so that they exactly know what those entities are and how they can be used.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Follow the eleven rules of DAX management</h5>
<p>DAX is the window of the semantic model to the outside world. It is via the DAX measures that users interact with the model. Hence the measures need to be appropriately named, faster to query, and proper formatting applied. Go through this <a href="https://capstoneanalytics.com.au/the-eleven-rules-of-dax-management/">article</a> to apply all the eleven rules of DAX management before pushing the measures to production.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Use external tools</h5>
<p>The use of external tools greatly increases productivity and agility. There are three main tools which are of importance, and they should be in the arsenal of every semantic modeler. They are all free to use and if you do not have them, get your IT department to install them for you.</p>
<p><a href="https://docs.tabulareditor.com/index.html">Tabular Editor</a></p>
<p>Tabular Editor is a tool that lets you easily manipulate and manage measures, calculated columns, display folders, perspectives and translations in Analysis Services Tabular and Power BI Models. You can also automate a lot of the modelling process by writing C# scripts that interacts with the Tabular Model and edits the model. There are a lot of custom C# scripts freely available to get your started. Once you get to know the objects you can manipulate in the Tabular Object Model, you can easily write scripts that performs formatting, column ordering, relationship creation etc. Modelling using Tabular Editor is a breeze and once you start using it you will never go back to using the clunky desktop GUI for your work.</p>
<p><a href="https://daxstudio.org/">DAX Studio</a></p>
<p>This is the ultimate tool for working with DAX queries. If you are writing lots of DAX, be it in the semantic model or report level measures you can test your queries for speeds, server timings, query plan etc. You can also use the DMV (Dynamic Management Views) to query the TOM model and get important insights like table size, number of rows, measure expressions etc.</p>
<p><a href="http://alm-toolkit.com/">ALM Toolkit</a></p>
<p>This is a great toolkit to manage and publish your datasets to different workspaces. You can compare two datasets and see what is different and push the changes you want to the workspace of your choice. By using this toolkit you are only pushing the metadata changes to a workspace and not the entire dataset. So if you have added 10 new measures into your desktop model, instead of publishing it the manual way using Power BI desktop and updating the model in service and running a refresh on it again, you only update the measures using this toolkit, without a need to refresh the entire model. A must have external tool for agile delivery.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Apply incremental refresh where possible</h5>
<p>Incremental refresh is a great way to reduce the memory footprint of your models while refreshing. When you apply incremental refresh policy on a fact table in your model you are locking in the past data and only incrementally refreshing the most recent data. Say you have a large fact table in your dataset with 200 million rows and five years&#8217; worth of data and you want to reduce the number of rows to be refreshed every day, you could apply an incremental refresh policy and lock in the first 4 years of data and only refresh the current year. So, every day the fact table only gets data for the current year which would be much less than 200 million which means the model consumes less memory during refresh and you stay well within your memory limit (in case of Power BI Premium subscription).</p>
<p>However, be mindful of the fact that if a table reload is required at the source, then you would need to disable incremental refresh in the model and bring in all the data once again. Be very careful of applying incremental refresh on a table in the model. Only do so when you are 100% sure that no table reloads will occur in the future.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<h3>REFRESH</h3>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Use pipelines in service</h5>
<p>Use deployment pipelines in Power BI service to push your models fom UAT to PROD. Deployment pipelines enable semantic modelers to manage the testing and publishing of their semantic models. You can also publish reports, paginated reports, dashboards, as well as dataflows. You can also automate it by using the <a href="https://learn.microsoft.com/en-us/power-bi/create-reports/deployment-pipelines-automation#use-the-power-bi-automation-tools-extension">Power BI Automation Tools Extension</a> in DevOps which is an effcient way of deploying models especially if there are multiple modes.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Automate refresh</h5>
<p>Automatic refresh of semantic models doesnt mean setting up a refresh schedule for the models. This will not work as if the underlying tables are being reloaded, say each night in the data warehouse the exact time of when the reloads are complete cannot be determined. Hence setting up a scheduled refresh for the semantic models means that the model will start refreshing before the reloads have finished. This results in time out issues apart from not refreshing the latest data.</p>
<p>In order to avoid such a scenario use the <a href="https://learn.microsoft.com/en-us/power-bi/connect-data/asynchronous-refresh">Power BI REST API</a> to refresh the models after the reload is complete. Using this APT you can also fine tune the refresh by specifying the Max Parallelism values, tables and partitions to refresh.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Monitor refresh</h5>
<p>Use the <a href="https://learn.microsoft.com/en-us/power-bi/enterprise/service-premium-gen2-metrics-app">Gen2 Metrics App</a> to monitor the Power BI Gen2 premium capacities. Among the features of this dashboard is the ability to monitor the refresh times, peak memory consumption, CPU usage and number of users utilising your semantic models.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>SUPPORT</h3>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Use source control</h5>
<p>Source control is a tricky subject in the Power BI world as there is no built in source control within Power BI. You would need to use a combination of Sharepoint/DevOps to manage your pbix/template files. A good place to start on an automated way to keep track of pbix files is here</p>
<p><a href="https://mutt0-ds.github.io/posts/2022/11/turbulent-journey-power-bi-source-control/">A turbulent journey through Power BI source control &#8211; Mutt0-ds Notes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Document the model</h5>
<p>It is important to document the model in production so that everyone from Managers to developers know what entities are available in the model. You can do this manually via Sharepoint/Confluence but it becomes cumbersome to maintain and error prone. An automated data glossary dashboard which extracts the metadata from your models in production is a much better scenario. This glossary gives you details on<br />
&#8211; M expressions of each query<br />
&#8211; Number of tables and columns in the model<br />
&#8211; Number of measures and their expressions<br />
&#8211; BUS matrix<br />
&#8211; Number of rows in the tables<br />
&#8211; Size of tables and columns in the model<br />
&#8211; Lineage between data warehouse tables/view to measures</p>
<p>Talk to us if you need help in implementing such a data glossary for your models.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Optimize the model</h5>
<p>Models in production should always be optimised to ensure they consume less memory and refresh and query faster. Memory is at a premium in Power BI (forgive the pun) so you should always strive to make sure the models only use the bare minimum necessary to meet the reporting requirements. Here are some steps to perform to make sure models refresh faster and consume less memory<br />
&#8211; Remove unnecessary columns from tables, especially fact table primary key columns<br />
&#8211; Filter rows which are not required for reporting. If there is only a reporting requirement for the last five years, do not include data from 2010 onwards<br />
&#8211; Decrease precision of decimal fields to 2 decimal points<br />
&#8211; Set MDX as false to non attribute columns (PK, DK, Record_effective)<br />
&#8211; Set right encoding for columns &#8211; dimension tables should have hash encoding and decimal fields benefit from value<br />
&#8211; Custom partition on tables<br />
&#8211; Reducing cardinality<br />
&#8211; Do not use calculated columns<br />
&#8211; Use aggregated tables if detailed grain is not required for reporting</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Automate semantic model testing</h5>
<p>How do you ensure that the measures you have written are correct? How do you know that the business can trust the numbers coming from the measures ? One way to do that is to test your semantic model against the source of the measures which in most cases are views. You can use the <a href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries">Execute Queries API</a> to query your models in production, extract the measure results and compare them against an equivalent SQL statement from the views. If you have a tester they can set up a testing framework in ADF and it can be automated to make sure that the measures are always giving the correct results.</li>
</ul>
</li>
</ul>
<p>So there it is, the end of this series on my musings from developing and deploying enterprise grade semantic models. As a parting note, developing enterprise grade semantic models is an exciting role to work in as you get to collaborate with a wide variety of stakeholders while having ultimate control over the semantic model. Treat it like a product and make sure you listen deeply to the users before adding any new features. Finally, your job as a semantic modeler is to make it easier for the end users to create reports. Provide as much details as possible on how to use it and evangelise it to everyone you meet in the organisation. All the best !</li>
</ul>
</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part3-technical-learnings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Musings from developing and deploying enterprise grade semantic models &#8211; Part 2: General learnings</title>
		<link>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings</link>
					<comments>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings/#respond</comments>
		
		<dc:creator><![CDATA[Abhijith DSouza]]></dc:creator>
		<pubDate>Mon, 31 Oct 2022 05:43:11 +0000</pubDate>
				<category><![CDATA[Power BI]]></category>
		<category><![CDATA[DAX]]></category>
		<category><![CDATA[Enterprise Semantic Model]]></category>
		<category><![CDATA[Semantic Layer]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">https://capstoneanalytics.com.au/?p=2873</guid>

					<description><![CDATA[In Part 1 of this series, I gave a brief introduction to the concept of semantic models and why they should be designed. In this article I discuss the general learnings from developing and deploying semantic models If you are doing it all by yourself, it is not enterprise grade As discussed in Part 1 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In <a href="https://capstoneanalytics.com.au/learnings-from-developing-enterprise-grade-semantic-models/">Part 1</a> of this series, I gave a brief introduction to the concept of semantic models and why they should be designed. In this article I discuss the general learnings from developing and deploying semantic models</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>If you are doing it all by yourself, it is not enterprise grade</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">As discussed in Part 1 these are the following people I collaborated with while building enterprise grade semantic models for a major superannuation company in Australia</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li style="list-style-type: none;">
<ul>
<li>Information Architects</li>
<li>Solution Architects</li>
<li>Data Stewards</li>
<li>Product Champions</li>
<li>Data Modelers</li>
<li>Business Analysts</li>
<li>Business Intelligence Developers</li>
<li>Testers</li>
<li>Delivery Managers</li>
<li>Report Developers</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">It truly does take a team to ideate, design, test, validate, and support the build of enterprise grade semantic models. In the past, I have developed pseudo enterprise grade models as I was donning multiple hats and that resulted in a not optimal data warehouse and subsequently the semantic model wasn&#8217;t fit for reporting. Hence is important to have specialists for the above roles. If you have built a semantic model by yourself, it is probably not enterprise grade. This leads to the next point</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Designing a report for an enterprise is not the same as semantic modeling</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">Many Power BI consultants make the mistake of interpreting a report built for a business unit in an enterprise as enterprise grade semantic models. They are not one and the same. Firstly, the reports have been probably built by a single person meaning, the person building the report is the architect, data modeler, data engineer, semantic modeler, and a report developer all rolled into one. It is akin to building the Burj Khalifa all by yourself, simply not possible when you deal with enterprise data.</p>
<p style="padding-left: 80px;">That doesn&#8217;t mean you should not build Power BI models for enterprises. But due to the localised nature of it, the models will only be used by a section of the end users and the rest of them won&#8217;t have a clue about it. Enterprise models should be available to be consumed (via reports) by all employees within the organisation. Only then can you call the models truly enterprise grade.</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Semantic model is not the same as a data warehouse</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">A data warehouse is built to standards conforming to the industry business unit from which the data is sourced. It is usually designed using dimension modelling using techniques of conformed dimensions, slowly changing dimensions, enterprise bus matrix etc. However, it may not always be used as is by the business for reporting. For starters the field names in the data warehouse may be something like &#8220;MemberAccountBalance_Total&#8221;, which may not mean much to the business. However, in the semantic model you can change it to something like &#8220;Member Account Balance&#8221; which is understandable for everyone.</p>
<p style="padding-left: 80px;">The other reason is more important. The fact tables in the data warehouse in most cases cannot be used directly to extract the corporate measures. For ex: in Superannuation and Banking industries, one of the most important measures is the Member Count, both current and historical. The Member Counts here represent Members who have an account in the superannuation or banking organisation. The Member Count should be increasing over time as that means the company is growing and is able to make a profit. This measure is normally not modelled as a field in the fact table in the data warehouse. Hence a semantic layer view needs to be created so that this measure is derived by say joining the Member dimension (which has information on all member attributes) with other fact tables like MemberBalanceSnapshot table (which has information on members who have accounts) along with the required dimensions so that it can be sliced appropriately.</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Be prepared for multiple iterations</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">If you are building a semantic model for the first time, you will probably need a few iterations to get it right. The model which you ultimately choose will be the one which has the right granularity for corporate reporting, has the business approved field names, simpler DAX expressions, refreshes faster, queries faster and is well documented. It is recommended to start the iteration process by focusing on the correct field names, table names, measure names and definitions and begin by designing a high-fidelity prototype with the important fact, dimension tables and measures. The prototype should be parameterised so it can be deployed to different environments easily. This way you will have a version which will be ready to scale when you deploy the final model for production.</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Semantic modeling is not technically difficult</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">While the job of a semantic modeler is technically not that demanding, say as compared to a data engineer it is probably the role with the most exposure to all stakeholders. You are like a conduit between the business and the technical team. You are constantly fielding questions on the semantic model from the report developers/business, and it is your job to make sure their questions are answered satisfactorily.</p>
<p style="padding-left: 80px;">Requirements for new tables, columns, measures may come thick and fast and that is why it is critical to ask the right questions so that these requirements can be formalised through a demand portal and taken up by the technical team based on their priorities. Which brings us to the next point&#8230;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Have an excellent relationship with all relevant stakeholders</h5>
</li>
</ul>
</li>
</ul>
<p style="padding-left: 80px;">Because a semantic modeler sits between business and the technical team, they should maintain excellent relationships with all parties involved. They should not only be adept at talking to the data modelers and architects on things like measure definitions, table grain, memory usage, processing times etc. they should also be skillful at explaining the model in simple terms while talking to business.</p>
<p style="padding-left: 80px;">You need to be persuasive to make your point while also seeking clarity to better inform your decision-making process. These are some of the soft skills which you need to master in order to be successful in this role.</p>
<ul>
<li style="list-style-type: none;"></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Musings from developing and deploying enterprise grade semantic models &#8211; Part 1: Introduction</title>
		<link>https://capstoneanalytics.com.au/learnings-from-developing-enterprise-grade-semantic-models/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=learnings-from-developing-enterprise-grade-semantic-models</link>
					<comments>https://capstoneanalytics.com.au/learnings-from-developing-enterprise-grade-semantic-models/#respond</comments>
		
		<dc:creator><![CDATA[Abhijith DSouza]]></dc:creator>
		<pubDate>Fri, 21 Oct 2022 01:12:36 +0000</pubDate>
				<category><![CDATA[Power BI]]></category>
		<category><![CDATA[DAX]]></category>
		<category><![CDATA[Enterprise Semantic Model]]></category>
		<category><![CDATA[Semantic Layer]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">https://capstoneanalytics.com.au/?p=2834</guid>

					<description><![CDATA[For the past one year, I have been fortunate enough to work on a digital transformation project for one of Australia&#8217;s largest superannuation funds to develop enterprise grade semantic models. I worked with a wonderful team comprising Solution Architects, Information Architects, Data Modelers, Data Stewards, Product Champions, Business Intelligence Analysts, Testers, Report Developers, and Delivery [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>For the past one year, I have been fortunate enough to work on a digital transformation project for one of Australia&#8217;s largest superannuation funds to develop enterprise grade semantic models. I worked with a wonderful team comprising Solution Architects, Information Architects, Data Modelers, Data Stewards, Product Champions, Business Intelligence Analysts, Testers, Report Developers, and Delivery Managers to ideate, design, test, deploy, and document semantic models which contained superannuation data for the funds&#8217; members. It was an exciting project with lots of challenges and lots of learnings. So I thought I would make a blog post to share the learnings with everybody.</p>
<p>Firstly, what is a semantic model ? Before we get to the semantic model we need to understand its relationship with respect to the semantic layer. According to Wikipedia:</p>
<p style="text-align: center;"><em>A <b>semantic layer</b> is a business representation of corporate data that helps end users access data autonomously using common business terms. A semantic layer maps complex data into familiar business terms such as product, customer, or revenue to offer a unified, consolidated view of data across the organization</em></p>
<p>The above definition is as good as it gets without the use of unnecessary jargon. So we will stick with this going forward. Where does the semantic layer sit in a modern BI/analytics landscape. The below simplified architecture answers the question. This is for a Power BI landscape but would work similarly with other tools.</p>
<p><img decoding="async" class=" wp-image-2847 alignnone" src="https://capstoneanalytics.com.au/wp-content/uploads/2022/09/model-framework.png" alt="" width="1141" height="271" srcset="https://capstoneanalytics.com.au/wp-content/uploads/2022/09/model-framework-980x233.png 980w, https://capstoneanalytics.com.au/wp-content/uploads/2022/09/model-framework-480x114.png 480w" sizes="(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1141px, 100vw" /></p>
<p>&nbsp;</p>
<p>So as you can see, the semantic layer is that layer which sits between the data warehouse (which is the output of the Transformation Layers) and the reporting layer. The semantic layer consists of two parts</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Semantic Layer DB &#8211; These are the SQL views which are created in the database from the Fact and Dimension tables. The views can be a one-to-one copy of the tables or they can be enhanced with fields containing report level logic. It is in these views that business friendly names are given to the fields. So instead of &#8216;MemberName&#8217; we would have &#8216;Member Name&#8217; as a field. It is important that no business transformations are applied in the views. All transformations are to be applied in the transformation layers and the data loaded to the data warehouse.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Semantic Model PBI &#8211; The views are imported into a Power BI Desktop model which is called the semantic model. Corporate measures, which have been defined by data stewards are then calculated in the model. Most of these measures are simple aggregations of fields in the tables (SUM, DISTINCTCOUNT). The semantic model is then published to PBI service where report developers connect to it, design reports and share via apps. The semantic model is the &#8216;single version of truth&#8217; and is used as the primary data source for enterprise reports. In this example, all superannuation related reports would connect to this model to generate insights. It is the design and deployment of this semantic model which would be the focus of this series of blogs.</li>
</ul>
</li>
</ul>
<p>So in essence, in the PBI world, the semantic model is a dataset with corporate measures, used to query organisational metrics. The reports which query the dataset are in fact &#8216;Thin Reports&#8217;, with the report developers having the ability to create report level measures. In the simplest architecture the dataset contains many datamarts and the data is imported into the model. All datamarts have a star schema associated with them.</p>
<p>So why build the semantic model after all ? There are several reasons why an organisation should implement a semantic model. The key reasons are given below</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Single Version of Truth (SVOT)</h5>
<p>When implemented correctly, the semantic model provides accurate and trustworthy data for key organisational metrics which serve as the SVOT no matter which tool is used to query it. Because the metrics have been defined in consultation with relevant stakeholders from the business, any report connecting to the model and querying the metrics (in the form of measures) produces the same result. This is quite powerful as there is no longer confusion on what the metrics mean, and everyone will be on the same page discussing the reports.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Seamless collaboration</h5>
<p>A semantic model allows for creation of a data model which is a visual description of the business for analyzing, understanding, and clarifying the data and the associated relationships. This model can not only be used by the business to generate insights but can also be used by data scientists to complement the raw data which they use in their models. Composite models, which are models which are created by combining the semantic model with business unit specific data (say salary data) can also be created and shared with the relevant stakeholders. Thus the creation of the semantic model enables easy authoring, sharing, and collaborating of data models and insights.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Reduce computing costs</h5>
<p>With most business running their data warehouses in the cloud, ad-hoc querying the data warehouse for every report leads to poor workload management and long running queries being run multiple times. With a cached semantic model, only optimised queries (via views) which are at the grain required for business reporting are run, which improves query performance and reduces costs.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Simplify DAX calculations</h5>
<p>The semantic model is structured in such a way that measures in the model are simple aggregations of the columns in the views. Since all the transformations are done prior to data being loaded into the data warehouse and report specific logic being implemented in the views, writing DAX to create either the corporate measures or report level measures becomes easier. This is why it is important to have solution architects and data modelers in your team who would make sure that the views are at the right grain and fit for purpose for reporting.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Improved security</h5>
<p>Users can be authenticated to use the semantic model with Azure AD groups and further, Row Level Security can be implemented at both the DB level and at the dataset level to protect sensitive data and limit access to data for users based on their roles in the organisation.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<p>So what constitutes an enterprise grade semantic model ? In my opinion, the following conditions should be satisfied for a model to be classified as enterprise grade</p>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Represent data from a business unit</h5>
<p>The semantic models which I designed enabled end users to query data related to the members of the superannuation fund. Metrics such as Member Count, Exited Member Count,Member Account Balance, New Join Count etc could be queried from the model by slicing them with dimensions such as Member, Age Bracket, Employer, Payment Institution, Amount Bracket etc. In short, the relevant business unit in this case was Superannuation and the semantic model contained almost all the data required by the business to attract and retain members into the fund. Normally there is an executive sponsor who funds the project to set the ball rolling.</p>
<p>&nbsp;</li>
<li>
<h5>Governed corporate measures</h5>
<p>It doesn&#8217;t make sense to model the data from a business unit if there is no consensus on the definitions of the corporate metrics. It is important that even before conceptualising the data platform, a thorough process is undertaken to define the most important corporate metrics and get them approved by the relevant stakeholders. This can be facilitated by setting up a Data Office in the organisation which is responsible for signing off on the corporate measures based on the approved definitions from the stakeholders.</p>
<p>&nbsp;</li>
<li>
<h5>Architecting the solution</h5>
<p>So, you have identified which business unit&#8217;s data to model and have also got sign offs on the corporate metrics which need to be the output of the model. It is then critical to start brainstorming on how the solution would look like. This is where the Architects come into play. Most enterprise data reside in databases in different source systems. The architects will perform a detail analysis on what is the current state of the source systems, the best way to extract the data from the source systems, selecting the appropriate cloud platform for the solution, and designing the conceptual and logical design in tandem with the Data Modelers. The data warehouse is then built by the data engineers based on the specifications given to them by the Data Modeler. The semantic model is then designed from the data in the data warehouse based on the reporting requirements of the business. One of the core architectural principles is that any reusable logic (columns) should be applied as close to the source as practical. ie, there should be no columns defined in Power Query or in the Power BI model. If the solution is not architected, then it is not an enterprise grade model.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>
<h5>Deliver fast queries</h5>
<p>Once the solution is architected and the corporate measures have been defined in the model based on the business definitions, it is time to deploy the model. If the reports connecting to the semantic model cannot query a measure in less than 3 seconds (nothing scientific about measures being able to run in less than 3 seconds, just a number which was felt good enough at the time of deployment), then it is time to go back to the drawing board. The semantic model should be fast enough to respond to the needs of the business. A slow model will impede adoption and people will lose trust in the efficacy of the model.</li>
</ul>
</li>
</ul>
<p>&nbsp;</p>
<p>Hopefully this article has piqued your interest in all things enterprise semantic modelling using Power BI &#8211; They Why&#8217;s and the What&#8217;s. In the next series of articles, I will share about the learnings I gained from developing and deploying enterprise grade semantic models. Some will be <a href="https://capstoneanalytics.com.au/musings-from-developing-and-deploying-enterprise-grade-semantic-models-part2-general-learnings/">general</a>, and others will be technical. Hope you find them useful too.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://capstoneanalytics.com.au/learnings-from-developing-enterprise-grade-semantic-models/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
