{"id":2096,"date":"2025-04-29T13:16:50","date_gmt":"2025-04-29T03:16:50","guid":{"rendered":"https:\/\/www.dynamicwebtraining.com.au\/blog\/?p=2096"},"modified":"2025-06-23T14:59:37","modified_gmt":"2025-06-23T04:59:37","slug":"how-to-write-your-first-dax-measures-in-power-bi","status":"publish","type":"post","link":"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi","title":{"rendered":"How to Write Your First DAX Measures in Power BI"},"content":{"rendered":"\n<p>The Data Analysis Expressions &#8211; DAX is a powerful and versatile formula language used in business intelligence tools such as Power BI, Excel, Power Pivot, and SQL Server Analysis Services (SSAS) Tabular. It plays a pivotal role in creating dynamic visualizations, leading to insightful data analysis. <a href=\"https:\/\/www.dynamicwebtraining.com.au\/power-bi-training-courses\/power-bi-dax-course\">Mastering DAX is essential<\/a> for getting the most value out of these tools, it empowers analysts towards data-driven decision-making.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>This step-by-step guide elaborates on the value of DAX in business intelligence tools and the professional significance of mastering it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Measures vs. Calculated Columns: What\u2019s the Difference?<\/h2>\n\n\n\n<figure class=\"wp-block-table has-small-font-size\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>Calculated Column<\/th><th>Measure<\/th><\/tr><\/thead><tbody><tr><td><strong>Evaluation Time<\/strong><\/td><td>Row-by-row (when data is loaded)<\/td><td>On the fly (when queried)<\/td><\/tr><tr><td><strong>Storage<\/strong><\/td><td>Takes up space in the model<\/td><td>No extra storage required<\/td><\/tr><tr><td><strong>Use Case<\/strong><\/td><td>Creating new data fields<\/td><td>Aggregating\/analyzing data<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-normal-font-size\">Tip: <strong>Use measures<\/strong> when you&#8217;re calculating totals, averages, or business KPIs.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Step-by-Step: Writing Basic DAX Formulas<\/h2>\n\n\n\n<p><br><strong> Step 1: Load the Dataset<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Download the <a href=\"https:\/\/github.com\/microsoft\/powerbi-desktop-samples\/blob\/main\/AdventureWorks%20Sales%20Sample\/AdventureWorks%20Sales.xlsx\">Adventure Works Sales<\/a> dataset.<\/li>\n\n\n\n<li>Open <strong>Power BI Desktop<\/strong>.<\/li>\n\n\n\n<li>Go to <strong>Home > Get Data > Excel<\/strong>.<\/li>\n\n\n\n<li>Select your file <strong>AdventureWorks Sales.xlsx<\/strong> and click <strong>Load<\/strong>.<\/li>\n\n\n\n<li>From the right-hand pane, open the <strong>Data<\/strong> pane.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"303030\" data-has-transparency=\"false\" style=\"--dominant-color: #303030;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"717\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1024x717.webp\" alt=\"1 Navigator DAX Measures - Dynamic Web Training\" class=\"wp-image-2097 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1024x717.webp 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-300x210.webp 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1536x1076.webp 1536w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1200x840.webp 1200w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator.webp 1542w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Step 2: Create Your First Measure \u2013 Total Sales<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right-click on the table <strong>Sales > New measure<\/strong>.<\/li>\n\n\n\n<li>Enter the following DAX: <br><code>Total Sales = SUM(Sales[Sales Amount])<\/code><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right-click the <strong>Sales<\/strong> table and select <strong>New Measure<\/strong>.<\/li>\n\n\n\n<li>Enter the following DAX formula: <code>Average Sales = AVERAGE(Sales[Sales Amount])<\/code><\/li>\n\n\n\n<li>Right-click the <strong>Customer<\/strong> table and select <strong>New Measure<\/strong>.<\/li>\n\n\n\n<li>Use the following formula: <code>Customer Count = COUNT(Customer[Customer ID])<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Step 4: Add Measures to Table Visuals<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a <strong>Card<\/strong> visualization for each measure.<\/li>\n\n\n\n<li>Create a <strong>Table<\/strong> visual by adding <strong>Country-Region, Total Sales, Average Sales, and Customer Count <\/strong>to the Columns section.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"614c47\" data-has-transparency=\"false\" style=\"--dominant-color: #614c47;\" loading=\"lazy\" decoding=\"async\" width=\"861\" height=\"496\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/2-dax-measures-table.webp\" alt=\"2 Country Table DAX Measures - Dynamic Web Training\" class=\"wp-image-2098 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/2-dax-measures-table.webp 861w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/2-dax-measures-table-300x173.webp 300w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><\/figure>\n\n\n\n<p>We have used Adventure Works Sales Dataset to create measures using <strong>SUM<\/strong>, <strong>AVERAGE<\/strong>, and <strong>COUNT<\/strong>, and visualized them with <strong>Cards and a Table<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Step-by-Step: Using IF Statements and Conditional Logic in Power BI<\/h2>\n\n\n\n<p><strong>Step 1: Writing a Basic IF Statement<\/strong><\/p>\n\n\n\n<p>To create custom logic, DAX includes logical operators such as IF() and SWITCH(). The measure we&#8217;ll develop in this example will classify sales performance according to the Total Sales value.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the Data pane, right-click on the Sales table and select New measure.<\/li>\n\n\n\n<li>Enter the following DAX formula: <code>Sales Status = IF([Total Sales] > 100000, \"Good\", \"Needs Improvement\")<\/code><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-506cf79b91fbeaadbc60b6d45d202a33\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The IF() function checks if <strong>Total Sales<\/strong> is greater than <strong>100,000<\/strong>.<\/li>\n\n\n\n<li>If true, it returns &#8220;Good&#8221;; otherwise, it returns &#8220;Needs Improvement&#8221;.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 2: Writing a SWITCH Statement (Customer Segment)<\/strong><\/p>\n\n\n\n<p>The SWITCH() function is useful when evaluating <strong>multiple conditions<\/strong>. We will classify Customers into different types using SWITCH().<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right-click the Sales <strong>table<\/strong> and choose <strong>New measure<\/strong>.<\/li>\n\n\n\n<li>Enter the following DAX formula: <br><code>Customer Segment = <br>SWITCH( <br>TRUE(), [Total Sales] &gt; 100000, \"High Value\", [Total Sales] &gt; 50000, \"Medium Value\", \"Low Value\" <br>)<\/code><br><br><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-48619d0a1a6604d6e747a16d554b66b6\"><strong>Explanation<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The SWITCH() function checks the value of the <strong>Total Sales<\/strong>.<\/li>\n\n\n\n<li>If Total Sales is higher than <strong>100000<\/strong>, it returns <strong>&#8220;High Value&#8221;<\/strong>.<\/li>\n\n\n\n<li>If Total Sales is higher than <strong>50000<\/strong>, it returns <strong>&#8220;Medium Value&#8221;<\/strong>.<\/li>\n\n\n\n<li>Otherwise, it returns <strong>&#8220;Low Value&#8221;<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 3: Add the IF and SWITCH Measure to a Visual<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select the table visual that we made earlier.<\/li>\n\n\n\n<li>Drag <strong>Customer Segment<\/strong> and <strong>Sales Status<\/strong> measures into the Columns section.<\/li>\n<\/ol>\n\n\n\n<p><strong>Step 4: Use IF and SWITCH in Conditional Formatting<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <strong>Format<\/strong> pane.<\/li>\n\n\n\n<li>Click on the cell element drop-down, set <strong>Conditional formatting<\/strong> for <strong>Sales Status<\/strong> and <strong>Customer Segment<\/strong>.<\/li>\n\n\n\n<li>Set up rules to format the Customer Segment measure by color-coding the background color as <strong>Green<\/strong> for &#8220;High Value,&#8221; brown for &#8220;Medium Value,&#8221; and green for \u201cLow Value.\u201d<\/li>\n\n\n\n<li>Similarly, set up rules to format the Sales Status measure by adding icons, i.e, <strong>Green Circle<\/strong> for &#8220;Good,&#8221; and <strong>yellow Triangle<\/strong> for \u201cNeeds Improvement.\u201d Sort the table with Customer Count.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"535553\" data-has-transparency=\"false\" style=\"--dominant-color: #535553;\" loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"779\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/3-dax-measures-conditional-formatting.webp\" alt=\"3 Conditional Formatting DAX Measures - Dynamic Web Training\" class=\"wp-image-2099 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/3-dax-measures-conditional-formatting.webp 800w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/3-dax-measures-conditional-formatting-300x292.webp 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>We&#8217;ve now used <strong>IF statements<\/strong> to categorize sales performance based on a threshold. <strong>SWITCH statements<\/strong> to categorize different segments dynamically. <strong>Conditional formatting<\/strong> to visually represent your results.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Step-by-Step: Understanding Row Context vs. Filter Context in DAX<\/h2>\n\n\n\n<p><strong>Step 1: Understanding Row Context &#8211; Sales Per Unit<\/strong><\/p>\n\n\n\n<p>Row Context is when Power BI evaluates an expression for each row of a table individually. This is typical in calculated columns or iterators such as SUMX and AVERAGEX. This is one of the most important DAX concepts.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In <strong>Data pane<\/strong>, right-click on the <strong>Sales<\/strong> table and select <strong>New column<\/strong>.<\/li>\n\n\n\n<li>Create a new column to calculate <strong>Sales per Unit<\/strong>: <code>Sales Per Unit = Sales[Sales Amount] \/ Sales[Order Quantity]<\/code><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-506cf79b91fbeaadbc60b6d45d202a33\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The formula calculates the sales per unit for each row.<\/li>\n\n\n\n<li>Power BI evaluates this formula row by row, which is Row Context.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 2: Understanding Filter Context &#8211; Sales in Australia<\/strong><\/p>\n\n\n\n<p><strong>Filter Context<\/strong> is when filters are applied from visuals, slicers, or page-level filters. It influences how Power BI evaluates measures.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Data pane<\/strong>, right-click on the <strong>Sales<\/strong> table and select <strong>New measure<\/strong>.<\/li>\n\n\n\n<li>Create a new measure to calculate <strong>Sales in Australia<\/strong>: <code>Sales in Australia = CALCULATE([Total Sales], SalesTerritory[Region] = \"Australia\")<\/code><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-506cf79b91fbeaadbc60b6d45d202a33\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CALCULATE() changes the <strong>filter context<\/strong> by applying the condition that <strong>Region = Australia<\/strong>.<\/li>\n\n\n\n<li>Power BI will now calculate Total Sales, but <strong>only for Australia<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 3: Combining Row Context and Filter Context &#8211; Sales Per Unit for Australia<\/strong><\/p>\n\n\n\n<p>Combining both contexts gives you <strong>advanced control over your calculations<\/strong>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In the <strong>Data pane<\/strong>, right-click on the <strong>Sales table<\/strong> and select <strong>New measure<\/strong>.<\/li>\n\n\n\n<li>Create a measure to calculate <strong>Sales per Unit in Australia<\/strong>: <br><code>Sales Per Unit in Australia = CALCULATE(<br>AVERAGE(<br>Sales[Sales Per Unit]), <br>SalesTerritory[Region] = \"Australia\"<br>)<\/code><\/li>\n\n\n\n<li>Press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-506cf79b91fbeaadbc60b6d45d202a33\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This measure calculates <strong>Sales per Unit<\/strong> but only for rows where the region is <strong>Australia<\/strong>.<\/li>\n\n\n\n<li>It combines <strong>Row Context<\/strong> (for individual row calculations) and <strong>Filter Context<\/strong> (only for the Australia).<\/li>\n<\/ul>\n\n\n\n<p><strong>Step 4: Add all the Measures to a Visual<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add a Funnel Chart <strong>visualization<\/strong>.<\/li>\n\n\n\n<li>Drag <strong>Sales per Unit, Sales in Australia, and Sales Per Unit in Australia<\/strong> into the <strong>Values<\/strong> section.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"434c53\" data-has-transparency=\"false\" style=\"--dominant-color: #434c53;\" loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"580\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/4-dax-measures-visualization.webp\" alt=\"Visualization DAX Measures - Dynamic Web Training\" class=\"wp-image-2100 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/4-dax-measures-visualization.webp 1008w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/4-dax-measures-visualization-300x173.webp 300w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/figure>\n\n\n\n<p><strong>Total Sales<\/strong> is broken down into its components, with a specific focus on the <strong>Australian market<\/strong> and <strong>Sales Per Unit in Australia<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Why Row Context and Filter Context are Important?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Row Context<\/strong> allows for row-level calculations in <strong>calculated columns<\/strong> or <strong>iterators<\/strong> like SUMX.<\/li>\n\n\n\n<li><strong>Filter Context<\/strong> is applied via filters or slicers and is controlled using CALCULATE() to modify the context in which a measure is evaluated.<\/li>\n\n\n\n<li>Mastering the combination of both contexts is crucial for building <strong>dynamic and insightful Power BI reports<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Best Practices for Organizing Measures in Power BI<\/h2>\n\n\n\n<p><strong>1. Create a Measure Table<\/strong><\/p>\n\n\n\n<p>Organizing measures in a <strong>dedicated table<\/strong> improves the structure of your Power BI model and keeps it easy to navigate.<\/p>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-defcf949e44a0fe67c0672a5a879badc\"><strong>Why Use a Measure Table?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Helps to <strong>separate calculations<\/strong> from data tables, improving readability.<\/li>\n\n\n\n<li>Reduces clutter in the <strong>Data pane<\/strong>.<\/li>\n\n\n\n<li>Makes your report <strong>more professional<\/strong> by consolidating all measures in one place.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-accent-color has-text-color has-link-color wp-elements-c483f2883d6a0e656c9603a6a931547e\"><strong>How to Create a Measure Table:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>On the <strong>Home ribbon<\/strong>, click <strong>Enter Data<\/strong>. This allows you to create a new table manually.<\/li>\n\n\n\n<li><strong>Name the table<\/strong> something like &#8220;_Measures&#8221;. <strong>Enter a column name<\/strong> (e.g., Measure1).<\/li>\n\n\n\n<li>Click <strong>OK<\/strong> to create the empty table. Now, you&#8217;ll have an empty table called <strong>_Measures<\/strong> with a placeholder row.<\/li>\n\n\n\n<li>After creating the measures, <strong>drag them into the _Measures table<\/strong> in the <strong>Data pane<\/strong>.<\/li>\n\n\n\n<li>If you\u2019re using the formula bar, you can directly write measures under this table.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"232323\" data-has-transparency=\"false\" style=\"--dominant-color: #232323;\" loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"727\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/5-dax-measures-create-table.webp\" alt=\"5 Create Table DAX Measures - Dynamic Web Training\" class=\"wp-image-2101 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/5-dax-measures-create-table.webp 682w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/5-dax-measures-create-table-281x300.webp 281w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/figure>\n\n\n\n<p><strong>2. Use Clear Naming Conventions<\/strong><\/p>\n\n\n\n<p>Clear and consistent naming conventions are essential for organizing and understanding your DAX measures.<\/p>\n\n\n\n<p><strong>Why Use Clear Naming Conventions?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Easy to read and understand<\/strong> \u2013 both for you and other users.<\/li>\n\n\n\n<li>Helps you <strong>locate measures<\/strong> quickly.<\/li>\n\n\n\n<li>Makes collaboration easier by avoiding confusion.<\/li>\n<\/ul>\n\n\n\n<p><strong>3. Add Descriptions to Measures<\/strong><\/p>\n\n\n\n<p>Adding <strong>descriptions<\/strong> to measures is a great way to <strong>document your logic<\/strong> and ensure others (or future you) understand the measure\u2019s purpose.<\/p>\n\n\n\n<p><strong>Why Add Descriptions?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Helps team members or clients understand the measure.<\/li>\n\n\n\n<li>Makes it easier to revisit your reports after a long time.<\/li>\n\n\n\n<li>Provides clarity if you&#8217;re working on complex models.<\/li>\n<\/ul>\n\n\n\n<p><strong>How to Add Descriptions to Measures:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <strong>Model<\/strong> view. Right-click on the <strong>measure<\/strong> you want to describe in the <strong>Data pane<\/strong>.<\/li>\n\n\n\n<li>In the <strong>Properties pane<\/strong>, you will find the <strong>Description<\/strong> field.<\/li>\n\n\n\n<li>Enter a <strong>short explanation<\/strong> of the measure&#8217;s logic and purpose.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"2b2c2b\" data-has-transparency=\"false\" style=\"--dominant-color: #2b2c2b;\" loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"638\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/6-dax-measures-add-description.webp\" alt=\"6 Add Description DAX Measures - Dynamic Web Training\" class=\"wp-image-2102 not-transparent\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/6-dax-measures-add-description.webp 972w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/6-dax-measures-add-description-300x197.webp 300w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p><strong>An Example of Well-Organized Measure<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Measure Name<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>Customer Count<\/td><td>&#8220;Total number of distinct customers in the dataset.&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-h-3-font-size\">Conclusion<\/h2>\n\n\n\n<p>Congratulations! You&#8217;ve just written your <strong>first DAX measures<\/strong> and learned how to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Differentiate between <strong>Measures vs. Calculated Columns<\/strong><\/li>\n\n\n\n<li>Use basic <strong>aggregation functions<\/strong> like SUM, AVERAGE, COUNT<\/li>\n\n\n\n<li>Build <strong>IF logic and SWITCH statements<\/strong><\/li>\n\n\n\n<li>Understand <strong>Row Context vs. Filter Context<\/strong><\/li>\n\n\n\n<li>Follow best practices for <strong>organizing measures<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Mastering DAX takes time, but this is your first powerful step! We also offer a full suite of <a href=\"https:\/\/www.dynamicwebtraining.com.au\/power-bi-training-courses\">Power BI Courses<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Data Analysis Expressions &#8211; DAX is a powerful and versatile formula language used in business intelligence tools such as Power BI, Excel, Power Pivot, and SQL Server Analysis Services (SSAS) Tabular. It plays a pivotal role in creating dynamic visualizations, leading to insightful data analysis. Mastering DAX is essential for getting the most value&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1354],"tags":[],"class_list":["post-2096","post","type-post","status-publish","format-standard","hentry","category-power-bi"],"yoast_head":"<title>How to Write Your First DAX Measures in Power BI<\/title>\n<meta name=\"description\" content=\"View and Share Dynamic Web Training Blog Archives. This is a great source of articles and posts on Computer and IT training, tutorials and insights\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Write Your First DAX Measures in Power BI\" \/>\n<meta property=\"og:description\" content=\"Learn step-by-step on how to write your first DAX measures in Power BI to create dynamic visualizations, leading to insightful data analysis.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\" \/>\n<meta property=\"og:site_name\" content=\"Dynamic Web Training Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-29T03:16:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-23T04:59:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1024x717.webp\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@dynamicwebtrain\" \/>\n<meta name=\"twitter:site\" content=\"@dynamicwebtrain\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\",\"name\":\"Dynamic Web Training\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/DynamicWebTraining\/\",\"https:\/\/www.linkedin.com\/company\/dynamic-web-training\",\"https:\/\/twitter.com\/dynamicwebtrain\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2016\/02\/logo.png\",\"width\":361,\"height\":109,\"caption\":\"Dynamic Web Training\"},\"image\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/\",\"name\":\"Dynamic Web Training Blog\",\"description\":\"The Ultimate Training Experience.\",\"publisher\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2025\/04\/1-dax-measures-navigator-1024x717.webp\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#webpage\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\",\"name\":\"How to Write Your First DAX Measures in Power BI\",\"isPartOf\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#primaryimage\"},\"datePublished\":\"2025-04-29T03:16:50+00:00\",\"dateModified\":\"2025-06-23T04:59:37+00:00\",\"description\":\"Learn step-by-step on how to write your first DAX measures in Power BI to create dynamic visualizations, leading to insightful data analysis.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\",\"name\":\"Training Blog\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training\",\"name\":\"Training\"}},{\"@type\":\"ListItem\",\"position\":3,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training\/power-bi\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/training\/power-bi\",\"name\":\"Power BI\"}},{\"@type\":\"ListItem\",\"position\":4,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi\",\"name\":\"How to Write Your First DAX Measures in Power BI\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#webpage\"},\"author\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233\"},\"headline\":\"How to Write Your First DAX Measures in Power BI\",\"datePublished\":\"2025-04-29T03:16:50+00:00\",\"dateModified\":\"2025-06-23T04:59:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#webpage\"},\"publisher\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/how-to-write-your-first-dax-measures-in-power-bi#primaryimage\"},\"articleSection\":\"Power BI\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233\",\"name\":\"Dynamic Web Training\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g\",\"caption\":\"Dynamic Web Training\"},\"description\":\"Dynamic Web Training is Australia's leading provider of instructor led software training. We offer training courses in Adobe, Web Design, Graphic Design, Photoshop, InDesign, Dreamweaver and many more.\",\"sameAs\":[\"https:\/\/www.facebook.com\/DynamicWebTraining\/\",\"https:\/\/www.linkedin.com\/company\/dynamic-web-training\",\"https:\/\/twitter.com\/dynamicwebtrain\"]}]}<\/script>","_links":{"self":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/comments?post=2096"}],"version-history":[{"count":2,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions"}],"predecessor-version":[{"id":2104,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/2096\/revisions\/2104"}],"wp:attachment":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/media?parent=2096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/categories?post=2096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/tags?post=2096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}