{"id":33505,"date":"2021-01-21T16:09:45","date_gmt":"2021-01-21T16:09:45","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=33505"},"modified":"2021-01-21T16:09:46","modified_gmt":"2021-01-21T16:09:46","slug":"creating-calculated-columns","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/","title":{"rendered":"Creating Calculated Columns"},"content":{"rendered":"\n<p>You may use calculated columns, that use Data Analysis Expressions (DAX) formulas for defining a column\u2019s values. This involves anything from putting together text values from a couple of different columns to calculating a numeric value from other values.\u00a0Moreover, calculated columns are related to\u00a0measures\u00a0in that both are based on DAX formulas, but they vary in how they are used. In general, we use measures in a visualization&#8217;s\u00a0<strong>Values<\/strong>\u00a0area, for calculating results based on other fields. Also, you can use calculated columns as new\u00a0<strong>Fields<\/strong>\u00a0in the rows, axes, legends, and group areas of visualizations.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Steps to create a calculated column with values from related tables<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, to create your new column in the\u00a0<strong>ProductSubcategory<\/strong>\u00a0table, right-click or select the ellipsis\u00a0<strong>&#8230;<\/strong>\u00a0next to\u00a0<strong>ProductSubcategory<\/strong>\u00a0in the\u00a0<strong>Fields<\/strong>\u00a0pane, and select\u00a0<strong>New column<\/strong>\u00a0from the menu.<\/li><li>Secondly, when you select\u00a0<strong>New column<\/strong>, the\u00a0<strong>Formula bar<\/strong>\u00a0appears along the top of the Report canvas, ready for you to name your column and enter a DAX formula.<\/li><li>By default, a new calculated column is named\u00a0<strong>Column<\/strong>.\u00a0<\/li><li>In case, you want the values in your new column to start with the name in the\u00a0<strong>ProductCategory<\/strong>\u00a0field. Since this column is in a different but related table, you can use the\u00a0RELATED\u00a0function to help you get it.<\/li><li>Now, as wou want the\u00a0<strong>ProductCategory<\/strong>\u00a0column from the\u00a0<strong>ProductCategory<\/strong>\u00a0table. Select\u00a0<strong>ProductCategory[ProductCategory]<\/strong>, press\u00a0<strong>Enter<\/strong>, and then type a closing parenthesis.<\/li><li>Moreover, as you want dashes and spaces to separate the\u00a0<strong>ProductCategories<\/strong>\u00a0and\u00a0<strong>ProductSubcategories<\/strong>\u00a0in the new values, so after the closing parenthesis of the first expression, type a space, ampersand (<strong>&amp;<\/strong>), double-quote (<strong>&#8220;<\/strong>), space, dash (<strong>&#8211;<\/strong>), another space, another double-quote, and another ampersand.<\/li><li>Then, enter an opening bracket (<strong>[<\/strong>), and then select the\u00a0<strong>[ProductSubcategory]<\/strong>\u00a0column to finish the formula.<\/li><li>Lastly, complete the formula by pressing\u00a0<strong>Enter<\/strong>\u00a0or selecting the checkmark in the formula bar. The formula validates, and the\u00a0<strong>ProductFullCategory<\/strong>\u00a0column name appears in the\u00a0<strong>ProductSubcategory<\/strong>\u00a0table in the\u00a0<strong>Fields<\/strong>\u00a0pane.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Steps to create a calculated column that uses an IF function<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, create a new calculated column in the\u00a0<strong>Stores<\/strong>\u00a0table and name it\u00a0<strong>Active StoreName<\/strong>\u00a0in the formula bar.<\/li><li>In the second step, After the\u00a0<strong>=<\/strong>\u00a0sign, begin typing\u00a0<strong>IF<\/strong>. The suggestion list will show what you can add. Select\u00a0<strong>IF<\/strong>.<\/li><li>Then, if the first argument for\u00a0<strong>IF<\/strong>\u00a0is a logical test of whether a store&#8217;s\u00a0<strong>Status<\/strong>\u00a0is &#8220;On&#8221;. Type an opening bracket\u00a0<strong>[<\/strong>, which lists columns from the\u00a0<strong>Stores<\/strong>\u00a0table, and select\u00a0<strong>[Status]<\/strong>.<\/li><li>Next, right after\u00a0<strong>[Status]<\/strong>, type\u00a0<strong>=&#8221;On&#8221;<\/strong>, and then type a comma (<strong>,<\/strong>) to end the argument. Moreover, the tooltip suggests that you now need to add a value to return when the result is TRUE.<\/li><li>If the store&#8217;s status is &#8220;On&#8221;, you want to show the store\u2019s name. Type an opening bracket (<strong>[<\/strong>) and select the\u00a0<strong>[StoreName]<\/strong>\u00a0column, and then type another comma. The tooltip now indicates that you need to add a value to return when the result is FALSE.<\/li><li>You want the value to be &#8220;Inactive&#8221;, so type\u00a0<strong>&#8220;Inactive&#8221;<\/strong>, and then complete the formula by pressing\u00a0<strong>Enter<\/strong>\u00a0or selecting the checkmark in the formula bar.<\/li><li>You can use your new\u00a0<strong>Active StoreName<\/strong>\u00a0column in visualizations just like any other field. To show\u00a0<strong>SalesAmounts<\/strong>\u00a0by\u00a0<strong>Active StoreName<\/strong>, select the\u00a0<strong>Active StoreName<\/strong>\u00a0field or drag it onto the Report canvas, and then select the\u00a0<strong>SalesAmount<\/strong>\u00a0field or drag it into the table. In this table, active stores appear individually by name, but inactive stores are grouped together at the end as\u00a0<strong>Inactive<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><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>\n","protected":false},"excerpt":{"rendered":"<p>You may use calculated columns, that use Data Analysis Expressions (DAX) formulas for defining a column\u2019s values. This involves anything from putting together text values from a couple of different columns to calculating a numeric value from other values.\u00a0Moreover, calculated columns are related to\u00a0measures\u00a0in that both are based on DAX formulas, but they vary in&#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":[1830,1828,3954],"class_list":["post-33505","page","type-page","status-publish","hentry","category-microsoft-azure","tag-da-100-study-guide","tag-exam-da-100-analyzing-data-with-microsoft-power-bi-exam-guide","tag-microsoft-exam-da-100-free-practice-test"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating Calculated Columns - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 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\/creating-calculated-columns\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Calculated Columns - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-21T16:09:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.com\/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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/\",\"name\":\"Creating Calculated Columns - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2021-01-21T16:09:45+00:00\",\"dateModified\":\"2021-01-21T16:09:46+00:00\",\"description\":\"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating Calculated Columns\"}]},{\"@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":"Creating Calculated Columns - Testprep Training Tutorials","description":"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 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\/creating-calculated-columns\/","og_locale":"en_US","og_type":"article","og_title":"Creating Calculated Columns - Testprep Training Tutorials","og_description":"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2021-01-21T16:09:46+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/","name":"Creating Calculated Columns - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2021-01-21T16:09:45+00:00","dateModified":"2021-01-21T16:09:46+00:00","description":"Learn more about calculated columns with latest and updated practice test. Start preparing for Microsoft Exam DA-100 Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-calculated-columns\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Creating Calculated Columns"}]},{"@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\/33505","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=33505"}],"version-history":[{"count":2,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/33505\/revisions"}],"predecessor-version":[{"id":33523,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/33505\/revisions\/33523"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=33505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=33505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=33505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}