{"id":1772,"date":"2020-10-02T10:21:31","date_gmt":"2020-10-02T10:21:31","guid":{"rendered":"https:\/\/bi.unija.com\/en\/?p=1772"},"modified":"2020-10-22T11:48:02","modified_gmt":"2020-10-22T11:48:02","slug":"dax-functions","status":"publish","type":"post","link":"https:\/\/bi.unija.com\/en\/dax-functions\/","title":{"rendered":"DAX functions"},"content":{"rendered":"<p><em>For Power BI version 2.76.5678.782 (December 2019).<\/em><\/p>\n<p>Let&#8217;s look at the most common functions we use when working with DAX. All functions in this article (except for the function DIVIDE) are aggregator functions. This means they take a column (or table) as input and aggregate the values into a single result.<\/p>\n<h1>SUM()<\/h1>\n<p>Returns the sum of all the values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>SUM([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column to be aggregated.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>SUM_Example = SUM(Sales[Amount])<\/p>\n<p>Example calculates the sum of Amount column in the Sales table.<\/p>\n<h1>AVERAGE()<\/h1>\n<p>Returns the average of all the values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>AVERAGE([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column to be aggregated.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>AVERAGE_Example = AVERAGE(Sales[Amount])<\/p>\n<p>Example calculates the average of Amount column in the Sales table.<\/p>\n<h1>MIN()<\/h1>\n<p>Returns the lowest of all the values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>MIN([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column of values.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>MIN_Example = MIN(Sales[Amount])<\/p>\n<p>Example returns the lowest value of Amount column in the Sales table.<\/p>\n<h1>MAX()<\/h1>\n<p>Returns the highest of all the values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>MAX([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column of values.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>MAX_Example = MAX(Sales[Amount])<\/p>\n<p>Example returns the highest value of Amount column in the Sales table.<\/p>\n<h1>COUNT()<\/h1>\n<p>Returns the number of non-empty values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>COUNT([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column of values.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>COUNT_Example = COUNT(Sales[Amount])<\/p>\n<p>Example returns the number of non-empty values of Amount column in the Sales table.<\/p>\n<h1>COUNTBLANK()<\/h1>\n<p>Returns the number of empty values in a column.<\/p>\n<h2>Syntax<\/h2>\n<p>COUNTBLANK([Column])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Column of values.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>COUNTBLANK_Example = COUNTBLANK(Sales[Amount])<\/p>\n<p>Example returns the number of empty values of Amount column in the Sales table.<\/p>\n<h1>COUNTROWS()<\/h1>\n<p>Returns the number of rows in a table.<\/p>\n<h2>Syntax<\/h2>\n<p>COUNTROWS(Table)<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Table<\/td>\n<td>Table we want to count rows in.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>COUNTROWS_Example = COUNTROWS(&#8216;Sales&#8217;)<\/p>\n<p>Example returns the number of rows the Sales table.<\/p>\n<h1>DIVIDE()<\/h1>\n<p>Divides and returns the result. Returns BLANK in the case of dividing by 0.<\/p>\n<h2>Syntax<\/h2>\n<p>DIVIDE(Numerator, Denominator, [Alternative result])<\/p>\n<table>\n<tbody>\n<tr>\n<td>Parameter<\/td>\n<td>Description<\/td>\n<\/tr>\n<tr>\n<td>Numerator<\/td>\n<td>Numerator<\/td>\n<\/tr>\n<tr>\n<td>Denominator<\/td>\n<td>Denominator<\/td>\n<\/tr>\n<tr>\n<td>Alternative result<\/td>\n<td>Alternative result in case of errors or dividing by 0. If no alternative result is given, BLANK is used. (optional)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>DIVIDE_Example = DIVIDE(10, 2)<\/p>\n<p>Example divides 10 by 2 and returns 5.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For Power BI version 2.76.5678.782 (December 2019). Let&#8217;s look at the most common functions we use when working with DAX. All functions in this article (except for the function DIVIDE) are aggregator functions. This means they take a column (or<\/p>\n","protected":false},"author":5,"featured_media":1773,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[5,8],"class_list":["post-1772","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-intermediate","tag-dax","tag-power-bi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DAX functions - Bi Unija<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bi.unija.com\/en\/dax-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DAX functions - Bi Unija\" \/>\n<meta property=\"og:description\" content=\"For Power BI version 2.76.5678.782 (December 2019). Let&#8217;s look at the most common functions we use when working with DAX. All functions in this article (except for the function DIVIDE) are aggregator functions. This means they take a column (or\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bi.unija.com\/en\/dax-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Bi Unija\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-02T10:21:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-22T11:48:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Branka Trifunovi\u0107\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Branka Trifunovi\u0107\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/\",\"url\":\"https:\/\/bi.unija.com\/en\/dax-functions\/\",\"name\":\"DAX functions - Bi Unija\",\"isPartOf\":{\"@id\":\"https:\/\/bi.unija.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png\",\"datePublished\":\"2020-10-02T10:21:31+00:00\",\"dateModified\":\"2020-10-22T11:48:02+00:00\",\"author\":{\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10\"},\"breadcrumb\":{\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bi.unija.com\/en\/dax-functions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage\",\"url\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png\",\"contentUrl\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png\",\"width\":720,\"height\":480},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bi.unija.com\/en\/dax-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bi.unija.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DAX functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bi.unija.com\/en\/#website\",\"url\":\"https:\/\/bi.unija.com\/en\/\",\"name\":\"Bi Unija\",\"description\":\"Just another Bi site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bi.unija.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10\",\"name\":\"Branka Trifunovi\u0107\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g\",\"caption\":\"Branka Trifunovi\u0107\"},\"url\":\"https:\/\/bi.unija.com\/en\/author\/branka\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DAX functions - Bi Unija","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:\/\/bi.unija.com\/en\/dax-functions\/","og_locale":"en_US","og_type":"article","og_title":"DAX functions - Bi Unija","og_description":"For Power BI version 2.76.5678.782 (December 2019). Let&#8217;s look at the most common functions we use when working with DAX. All functions in this article (except for the function DIVIDE) are aggregator functions. This means they take a column (or","og_url":"https:\/\/bi.unija.com\/en\/dax-functions\/","og_site_name":"Bi Unija","article_published_time":"2020-10-02T10:21:31+00:00","article_modified_time":"2020-10-22T11:48:02+00:00","og_image":[{"width":720,"height":480,"url":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png","type":"image\/png"}],"author":"Branka Trifunovi\u0107","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Branka Trifunovi\u0107","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/bi.unija.com\/en\/dax-functions\/","url":"https:\/\/bi.unija.com\/en\/dax-functions\/","name":"DAX functions - Bi Unija","isPartOf":{"@id":"https:\/\/bi.unija.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage"},"image":{"@id":"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png","datePublished":"2020-10-02T10:21:31+00:00","dateModified":"2020-10-22T11:48:02+00:00","author":{"@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10"},"breadcrumb":{"@id":"https:\/\/bi.unija.com\/en\/dax-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bi.unija.com\/en\/dax-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bi.unija.com\/en\/dax-functions\/#primaryimage","url":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png","contentUrl":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/10\/27eng.png","width":720,"height":480},{"@type":"BreadcrumbList","@id":"https:\/\/bi.unija.com\/en\/dax-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bi.unija.com\/en\/"},{"@type":"ListItem","position":2,"name":"DAX functions"}]},{"@type":"WebSite","@id":"https:\/\/bi.unija.com\/en\/#website","url":"https:\/\/bi.unija.com\/en\/","name":"Bi Unija","description":"Just another Bi site","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bi.unija.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10","name":"Branka Trifunovi\u0107","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g","caption":"Branka Trifunovi\u0107"},"url":"https:\/\/bi.unija.com\/en\/author\/branka\/"}]}},"_links":{"self":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1772"}],"collection":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/comments?post=1772"}],"version-history":[{"count":1,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1772\/revisions"}],"predecessor-version":[{"id":1774,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1772\/revisions\/1774"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/media\/1773"}],"wp:attachment":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/media?parent=1772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/categories?post=1772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/tags?post=1772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}