{"id":33721,"date":"2021-01-23T11:51:46","date_gmt":"2021-01-23T11:51:46","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=33721"},"modified":"2021-01-23T12:08:38","modified_gmt":"2021-01-23T12:08:38","slug":"using-calculate-function-dax","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/","title":{"rendered":"Using CALCULATE Function DAX"},"content":{"rendered":"\n<p>You can use the CALCULATE Function DAX for evaluating a table expression in a modified filter context. Also, it modifies the&nbsp;filter context&nbsp;applied to an expression that returns a&nbsp;<em>scalar value<\/em>. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"syntax\"><strong>DAXCopy &#8211; Syntax<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>CALCULATETABLE(&lt;expression&gt;&#91;, &lt;filter1&gt; &#91;, &lt;filter2&gt; &#91;, \u2026]]])\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"parameters\"><strong>Parameters<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Term<\/th><th>Definition<\/th><\/tr><\/thead><tbody><tr><td>expression<\/td><td>The table expression to be evaluated.<\/td><\/tr><tr><td>filter1, filter2,\u2026<\/td><td>(Optional) Boolean expressions or table expressions that defines filters, or filter modifier functions.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Remember, the expression used as the first parameter must be a model table or a function that returns a table. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Types of Filters <\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Boolean filter expressions<\/li><li>Table filter expressions<\/li><li>Filter modification functions<\/li><\/ul>\n\n\n\n<p>Also, when there are multiple filters, they are evaluated by using the AND&nbsp;logical operator. That indicates all conditions must be TRUE at the same time.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"boolean-filter-expressions\"><strong>Boolean filter expressions<\/strong><\/h4>\n\n\n\n<p>A Boolean expression filter is an expression that evaluates to TRUE or FALSE. There are several rules that they must abide by:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>They can reference only a single column.<\/li><li>They cannot reference measures.<\/li><li>They cannot use a nested CALCULATE function.<\/li><li>They cannot use functions that scan or return a table, including aggregation functions.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"table-filter-expression\"><strong>Table filter expression<\/strong><\/h4>\n\n\n\n<p>The table expression filter implements a table object as a filter. This could be a reference to a model table, but it&#8217;s a function that returns a table object. Also, you can use the&nbsp;FILTER&nbsp;function to apply complex filter conditions, including those that cannot be defined by a Boolean filter expression.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"filter-modifier-functions\"><strong>Filter modifier functions<\/strong><\/h4>\n\n\n\n<p>The filter modification functions permits you to do more than simply add filters. They provide you with additional control when modifying filter context.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Function<\/th><th>Objectives<\/th><\/tr><\/thead><tbody><tr><td>REMOVEFILTERS<\/td><td>It is used to remove all filters, or filters from one or more columns of a table, or from all columns of a single table.<\/td><\/tr><tr><td>ALL&nbsp;<sup>1<\/sup>,&nbsp;ALLEXCEPT,&nbsp;ALLNOBLANKROW<\/td><td>It is used to remove filters from one or more columns, or from all columns of a single table.<\/td><\/tr><tr><td>KEEPFILTERS<\/td><td>It is used to add filter without removing existing filters on the same columns.<\/td><\/tr><tr><td>USERELATIONSHIP<\/td><td>It is used to engage an inactive relationship between related columns, in which case the active relationship will automatically become inactive.<\/td><\/tr><tr><td>CROSSFILTER<\/td><td>It is used to modify filter direction (from both to single, or from single to both) or disable a relationship.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For More visit: <a href=\"https:\/\/docs.microsoft.com\/en-us\/power-bi\/guidance\/dax-avoid-avoid-filter-as-filter-argument\" target=\"_blank\" rel=\"noreferrer noopener\">DAX avoid using FILTER<\/a> <\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.testpreptraining.ai\/analyzing-data-with-microsoft-power-bi-da-100-free-test\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png\" alt=\"Microsoft Exam DA-100 Free Practice Test\"\/><\/a><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You can use the CALCULATE Function DAX for evaluating a table expression in a modified filter context. Also, it modifies the&nbsp;filter context&nbsp;applied to an expression that returns a&nbsp;scalar value. DAXCopy &#8211; Syntax Parameters Term Definition expression The table expression to be evaluated. filter1, filter2,\u2026 (Optional) Boolean expressions or table expressions that defines filters, or filter&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[174],"tags":[4189,1830,3955,3954,4188],"class_list":["post-33721","page","type-page","status-publish","hentry","category-microsoft-azure","tag-calculate-function","tag-da-100-study-guide","tag-microsoft-exam-da-100-exam-questions","tag-microsoft-exam-da-100-free-practice-test","tag-using-calculate-function-dax"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using CALCULATE Function DAX - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using CALCULATE Function DAX - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-23T12:08:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/\",\"name\":\"Using CALCULATE Function DAX - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2021-01-23T11:51:46+00:00\",\"dateModified\":\"2021-01-23T12:08:38+00:00\",\"description\":\"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using CALCULATE Function DAX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using CALCULATE Function DAX - Testprep Training Tutorials","description":"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/","og_locale":"en_US","og_type":"article","og_title":"Using CALCULATE Function DAX - Testprep Training Tutorials","og_description":"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2021-01-23T12:08:38+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/","name":"Using CALCULATE Function DAX - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2021-01-23T11:51:46+00:00","dateModified":"2021-01-23T12:08:38+00:00","description":"Get ready to boost your chances to qualify Microsoft Exam DA-100 with latest practice test. Learn about Using CALCULATE Function DAX Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/using-calculate-function-dax\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Using CALCULATE Function DAX"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/33721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=33721"}],"version-history":[{"count":3,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/33721\/revisions"}],"predecessor-version":[{"id":33783,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/33721\/revisions\/33783"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=33721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=33721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=33721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}