{"id":1835,"date":"2026-09-01T12:00:41","date_gmt":"2026-09-01T12:00:41","guid":{"rendered":"https:\/\/entri.app\/explore\/?post_type=curriculum&#038;p=1835"},"modified":"2026-09-01T12:00:41","modified_gmt":"2026-09-01T12:00:41","slug":"dax-formulas","status":"publish","type":"curriculum","link":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/","title":{"rendered":"DAX Formulas"},"content":{"rendered":"<h2><strong><b>What Are DAX Formulas in Power BI?<\/b><\/strong><\/h2>\n<p>A DAX formula is an expression built from DAX functions, operators, and Table[Column] references that defines a calculated column, calculated table, or measure. Every DAX formula starts with a name, an equals sign, and then the expression that produces the result.<\/p>\n<h2><strong><b>Where DAX Formulas Are Used<\/b><\/strong><\/h2>\n<p>The same DAX formula language works in Power BI Desktop (for calculated columns, tables, and measures) and in Excel&#8217;s Power Pivot add-in, since both run on the same underlying DAX engine.<\/p>\n<h2><strong><b>Filter-Based DAX Formulas<\/b><\/strong><\/h2>\n<p>A DAX filter formula typically wraps CALCULATE() around a base measure, adding or overriding filter conditions \u2014 for example, calculating sales only for a specific region regardless of what&#8217;s selected elsewhere on the report page.<\/p>\n<h2><strong><b>Using a Slicer Value Inside a DAX Formula<\/b><\/strong><\/h2>\n<p>SELECTEDVALUE() reads the single value currently selected in a slicer and returns it (or a fallback value if multiple items are selected), letting a measure or text box respond dynamically to a user&#8217;s slicer choice.<\/p>\n<h2><strong><b>Writing More Complex DAX Formulas<\/b><\/strong><\/h2>\n<p>Complex DAX formulas usually nest several functions together \u2014 for example, CALCULATE() wrapped around FILTER(), combined with time intelligence functions for a year-over-year comparison. Using VAR to name intermediate results makes formulas like this far easier to read and debug than nesting everything in one line.<\/p>\n<h2><strong><b>How to Write a DAX Formula in Power BI<\/b><\/strong><\/h2>\n<p>This tutorial walks through writing a filtered DAX formula in about 6 steps \u2014 starting from a basic SUM() measure and wrapping it in CALCULATE() to apply a specific filter condition.<\/p>\n<h3><strong><b>Prerequisites<\/b><\/strong><\/h3>\n<ul>\n<li>Power BI Desktop with a Sales-style table loaded<\/li>\n<li>A basic measure already created, or willingness to create one in step 1<\/li>\n<\/ul>\n<h3><strong><b>Steps<\/b><\/strong><\/h3>\n<ul>\n<li><b><\/b><strong><b> Create a base measure: <\/b><\/strong>Total Sales = SUM(Sales[Amount]).<\/li>\n<li><b><\/b><strong><b> Decide what to filter: <\/b><\/strong>Identify the condition you want, e.g. only the West region.<\/li>\n<li><b><\/b><strong><b> Wrap the base measure in CALCULATE: <\/b><\/strong>West Sales = CALCULATE([Total Sales], Sales[Region] = &#8220;West&#8221;).<\/li>\n<li><b><\/b><strong><b> Test the formula: <\/b><\/strong>Add both measures to a table visual and confirm West Sales is a subset of Total Sales.<\/li>\n<li><b><\/b><strong><b> Add a slicer-driven version if needed: <\/b><\/strong>Use SELECTEDVALUE(Sales[Region]) inside a formula to react to whatever the user picks in a slicer.<\/li>\n<li><b><\/b><strong><b> Format the result: <\/b><\/strong>Set number formatting (currency, decimals) on the new measure via the Modeling ribbon.<\/li>\n<\/ul>\n<h3><strong><b>Common Errors &amp; Troubleshooting<\/b><\/strong><\/h3>\n<ul>\n<li>Filtered measure returns the same number as the unfiltered one \u2014 check that the filter condition inside CALCULATE actually matches values in the data (case and spelling matter).<\/li>\n<li>SELECTEDVALUE returns blank \u2014 this happens when multiple slicer values are selected at once; supply a second argument as a fallback label.<\/li>\n<li>Formula works in isolation but breaks inside a visual \u2014 check whether an existing page- or report-level filter is interacting unexpectedly with the formula&#8217;s own filter.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>What Are DAX Formulas in Power BI? A DAX formula is an expression built from DAX functions, operators, and Table[Column] references that defines a calculated column, calculated table, or measure. Every DAX formula starts with a name, an equals sign, and then the expression that produces the result. Where DAX Formulas Are Used The same [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","meta":{"_acf_changed":false},"curriculum-category":[101,91],"custom_linking_tags":[],"class_list":["post-1835","curriculum","type-curriculum","status-publish","hentry","curriculum-category-power-bi-dax","curriculum-category-power-bi-tutorials"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>DAX Formulas - Entri Free Materials<\/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:\/\/entri.app\/explore\/power-bi\/dax-formulas\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DAX Formulas - Entri Free Materials\" \/>\n<meta property=\"og:description\" content=\"What Are DAX Formulas in Power BI? A DAX formula is an expression built from DAX functions, operators, and Table[Column] references that defines a calculated column, calculated table, or measure. Every DAX formula starts with a name, an equals sign, and then the expression that produces the result. Where DAX Formulas Are Used The same [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Free Materials\" \/>\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:\/\/entri.app\/explore\/power-bi\/dax-formulas\/\",\"url\":\"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/\",\"name\":\"DAX Formulas - Entri Free Materials\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/explore\/#website\"},\"datePublished\":\"2026-09-01T12:00:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/explore\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DAX Formulas\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/explore\/#website\",\"url\":\"https:\/\/entri.app\/explore\/\",\"name\":\"Entri Free Materials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/explore\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/explore\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/explore\/#organization\",\"name\":\"Entri Free Materials\",\"url\":\"https:\/\/entri.app\/explore\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"contentUrl\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"caption\":\"Entri Free Materials\"},\"image\":{\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DAX Formulas - Entri Free Materials","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:\/\/entri.app\/explore\/power-bi\/dax-formulas\/","og_locale":"en_US","og_type":"article","og_title":"DAX Formulas - Entri Free Materials","og_description":"What Are DAX Formulas in Power BI? A DAX formula is an expression built from DAX functions, operators, and Table[Column] references that defines a calculated column, calculated table, or measure. Every DAX formula starts with a name, an equals sign, and then the expression that produces the result. Where DAX Formulas Are Used The same [&hellip;]","og_url":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/","og_site_name":"Entri Free Materials","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/","url":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/","name":"DAX Formulas - Entri Free Materials","isPartOf":{"@id":"https:\/\/entri.app\/explore\/#website"},"datePublished":"2026-09-01T12:00:41+00:00","breadcrumb":{"@id":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/explore\/power-bi\/dax-formulas\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/explore\/"},{"@type":"ListItem","position":2,"name":"DAX Formulas"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/explore\/#website","url":"https:\/\/entri.app\/explore\/","name":"Entri Free Materials","description":"","publisher":{"@id":"https:\/\/entri.app\/explore\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/explore\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/explore\/#organization","name":"Entri Free Materials","url":"https:\/\/entri.app\/explore\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/","url":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","contentUrl":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","caption":"Entri Free Materials"},"image":{"@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum\/1835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum"}],"about":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/types\/curriculum"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/users\/2"}],"wp:attachment":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/media?parent=1835"}],"wp:term":[{"taxonomy":"curriculum-category","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum-category?post=1835"},{"taxonomy":"custom_linking_tags","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/custom_linking_tags?post=1835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}