{"id":101567,"date":"2024-02-28T17:00:40","date_gmt":"2024-02-28T17:00:40","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=101567"},"modified":"2024-02-24T20:26:18","modified_gmt":"2024-02-24T20:26:18","slug":"model-optimization-available-in-mdx-property","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/uncategorized\/model-optimization-available-in-mdx-property\/","title":{"rendered":"Model Optimization: Available In MDX Property"},"content":{"rendered":"<p>Power BI Semantic Models have a property called <strong>Available In MDX<\/strong>. Each field in the model has this property and we can only see or change its value through XMLA. For example, we can use Tabular Editor for this.<\/p>\n<p>We can disable this property in the fields where it will not be needed (and in some cases, it may be many) and we will achieve some level of model optimization.<\/p>\n<p><strong>Important:<\/strong> The benefits are easier to notice when the model is in Import mode. All the examples here use Import mode. On Direct Query or Direct Lake, it&#8217;s more difficult to notice benefits.<\/p>\n<h2><strong>What is the Available in MDX Property<\/strong><\/h2>\n<p>The internal analysis services, core of Power BI, manages the semantic model.<\/p>\n<p>Power BI communicates with this service using <strong>DAX<\/strong>, so it&#8217;s not affected by this property (<em>mostly<\/em>). Excel, on the other hand, communicates using <strong>MDX<\/strong>.<\/p>\n<p>Excel allows the user to build pivot tables using the data from the semantic model. The user can choose which field will be positioned in columns, rows, or values, such as in the pivot table illustrated bellow.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"460\" class=\"wp-image-101568\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-spreadsheet-description-automat.png\" alt=\"A screenshot of a spreadsheet\n\nDescription automatically generated\" \/><\/p>\n<p>Here is the rub: For the field to be used in columns or rows, it needs a hierarchy, and this hierarchy is only built if the property <strong><em>Available in MDX<\/em><\/strong> is enabled.<\/p>\n<p>If we disable this property, the user can&#8217;t add the field in question as column or row in an Excel pivot table.<\/p>\n<p>On the other hand, do you notice how many fields in your semantic model will never be added as columns or rows in an excel pivot table?<\/p>\n<h2><strong>What Tools you will need<\/strong><\/h2>\n<p>We can check how this will affect our model using <strong>DAX Studio.<\/strong><\/p>\n<p>We can change the property value using <strong>Tabular Editor<\/strong><\/p>\n<p>Power BI .Tips portal has <a href=\"https:\/\/powerbi.tips\/2020\/08\/one-tool-to-install-them-all\/\" target=\"_self\" rel=\"noopener\">a tool to install external tools in Power BI<\/a>, it&#8217;s the easiest way to do it. Once installed, the external tools will appear in power bi menu, like the image below<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"128\" class=\"wp-image-101569\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-computer-description-automatica-4.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>Once you have tools like DAX Studio and Tabular Editor installed, you can open a model in Power BI and click on the tool. The tool will be connected to your model.<\/p>\n<p><strong>What&#8217;s the Impact<\/strong><\/p>\n<p>Using DAX Studio, you can check the size of your model. After opening DAX Studio, you click on <strong><em>Advanced<\/em><\/strong> menu -&gt; <strong><em>View Metrics<\/em><\/strong> button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"297\" height=\"122\" class=\"wp-image-101570\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-computer-description-automatica-5.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>The metrics show information about each table and field in the model, like the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"560\" class=\"wp-image-101571\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-computer-description-automatica-6.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>On our example, let&#8217;s use Tabular Editor to disable the Available in MDX property on the following tables and fields:<\/p>\n<p>Table City:<\/p>\n<ul>\n<li>WWICityID<\/li>\n<li>CityKey<\/li>\n<li>Location<\/li>\n<li>LastRecordedPopulation<\/li>\n<\/ul>\n<p>Table Fact_Sale:<\/p>\n<ul>\n<li>SaleKey<\/li>\n<\/ul>\n<p>Once we open the model in Tabular Editor, we will be able to navigate through the model, like the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"433\" class=\"wp-image-101572\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-computer-description-automatica-7.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>We select the fields which we would like to change and modify the property in the properties window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"131\" class=\"wp-image-101573\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-computer-description-automatica-8.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>After disabling the property, we can check the metrics in DAX Studio again.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"550\" class=\"wp-image-101574\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/a-screenshot-of-a-data-analysis-description-autom.png\" alt=\"A screenshot of a data analysis\n\nDescription automatically generated\" \/><\/p>\n<h2><strong>PBIX File Size<\/strong><\/h2>\n<p>Our example uses Import mode, making it easy to notice the impact on the PBIX file size. Of course, it&#8217;s not only a matter of size, but memory consumption on Power BI service and processing.<\/p>\n<p>File size before the property changes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"75\" class=\"wp-image-101575\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/word-image-101567-8.png\" \/><\/p>\n<p>File size after the property changes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"67\" class=\"wp-image-101576\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2024\/02\/word-image-101567-9.png\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power BI Semantic Models have a property called Available In MDX. Each field in the model has this property and we can only see or change its value through XMLA. For example, we can use Tabular Editor for this. We can disable this property in the fields where it will not be needed (and in&#8230;&hellip;<\/p>\n","protected":false},"author":50808,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"coauthors":[6810],"class_list":["post-101567","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/50808"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=101567"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101567\/revisions"}],"predecessor-version":[{"id":101578,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/101567\/revisions\/101578"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=101567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=101567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=101567"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=101567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}