{"id":8666,"date":"2023-06-19T06:33:00","date_gmt":"2023-06-19T04:33:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=8666"},"modified":"2023-10-19T15:57:22","modified_gmt":"2023-10-19T13:57:22","slug":"last-year-value-dax-power-bi","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/","title":{"rendered":"How to calculate last year value in Power BI with DAX formulas?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading has-text-align-left\"><strong><em>Power BI tutorial on how to use the SAMEPERIODLASTYEAR function in a DAX formula to calculate the last year value.<\/em><\/strong><\/h4>\n\n\n\n<p>To calculate the previous year value in a Power BI formula, simply use the two available DAX CALCULATE function combined with the PREVIOUS YEAR function. In financial dashboard and reports, use the previous year value for comparison and variance calculation with the current year. Indeed analysing financial figures is often about time comparison and rolling forecasts. Financial forecast uses rolling months, quarters or years.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-use-the-sameperiodlastyear-time-function-in-power-bi\">Use the SAMEPERIODLASTYEAR time function in Power BI<\/h2>\n\n\n\n<p>The SAMEPERIODLASTYEAR function in DAX is an advanced time-intelligence function tailored to make comparative analyses across identical periods in consecutive years. Unlike the Power BI <code>PREVIOUSYEAR<\/code> function, which only shifts the date context back by a year, <strong>SAMEPERIODLASTYEAR maintains the structure of your specified time period<\/strong>, whether it&#8217;s a quarter, month, or even a custom time span.<\/p>\n\n\n\n<p>This particular <strong>feature is beneficial to identify seasonal patterns or irregularities in the data<\/strong>. Importantly, this function works most effectively when you have a well designed date table in your Power BI model and that this <strong>table is marked as a date table<\/strong>. Doing so ensures that your date hierarchies are accurately understood by DAX, allowing SAMEPERIODLASTYEAR to execute seamless transitions in the time context.<\/p>\n\n\n\n<p>For instance, with a measure names sales, representing the current year:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Sales := SUM('Sales'[Amount])<\/pre>\n\n\n\n<p>It is possible create a new DAX measure for the previous year sales, called Sales LY, in order to get last year&#8217;s sales for the same date range. This feature enables nuanced analysis and lends greater fidelity to your business intelligence insights.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Sales LY := CALCULATE([Sales], SAMEPERIODLASTYEAR( 'time'[date_key]))<\/pre>\n\n\n\n<p>This formula would filter the sales data to include only the revenue from the previous calendar year, allowing for nuanced and strategic business planning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-calculate-last-year-value-in-power-bi-using-one-dax-formula\">Calculate last year value in Power BI using one DAX formula <\/h2>\n\n\n\n<p>The simplest option is to use directly the value from an existing column from the source table. The developer or business user imports the existing column in a Tabular Model or Power BI. Please note that it is necessary to use the REMOVEFILTERS function to display the results.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Sales Last Year = \nCALCULATE (\n    SUM ( sales[sales] ),\n    SAMEPERIODLASTYEAR ( 'time'[date_key] ),\n    REMOVEFILTERS ( sales )\n)<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"540\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/05\/power-bi-last-year-value-dax-formula.jpg\" alt=\"Calculate last year value in Power BI with a DAX formula\" class=\"wp-image-26602\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2023\/05\/power-bi-last-year-value-dax-formula.jpg 680w, https:\/\/expert-only.com\/wp-content\/uploads\/2023\/05\/power-bi-last-year-value-dax-formula-300x238.jpg 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><figcaption class=\"wp-element-caption\"><em>Calculate last year value in a Power BI report<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>To go further, the term <strong><a href=\"https:\/\/expert-only.com\/en\/concepts\/dax-data-analysis-expressions\/\">DAX stands for Data Analysis Expression<\/a><\/strong> and it&#8217;s a Microsoft language. For example, PowerPivot, Power BI reports and dashboards and also Tabular models use the DAX language. Check out the detailed documentation of the two functions from this article on the official Power BI website:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The official documentation for the DAX <a href=\"https:\/\/docs.microsoft.com\/en-us\/dax\/calculate-function-dax\" target=\"_blank\" rel=\"noreferrer noopener\">CALCULATE function<\/a>.<\/li>\n\n\n\n<li>And the official documentation for the DAX <a href=\"https:\/\/learn.microsoft.com\/en-us\/dax\/sameperiodlastyear-function-dax\" target=\"_blank\" rel=\"noreferrer noopener\">SAMEPERIODLASTYEAR<\/a> <a href=\"https:\/\/learn.microsoft.com\/en-us\/dax\/sameperiodlastyear-function-dax\" target=\"_blank\" rel=\"noreferrer noopener\">function<\/a>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h3>\n\n\n\n<p>This article is about the calculation of last year value in DAX for Power BI, but it also applies to the creation of time measures in an Analysis Services tabular model.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-check-out-this-frequently-asked-questions-about-dax-and-power-bi\">Check out this frequently asked questions about DAX and Power BI<\/h3>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1598373676095\"><strong class=\"schema-faq-question\">Is the last year sales total calculated automatically in Power BI? <\/strong> <p class=\"schema-faq-answer\">Per default, the total of last year sales are not calculated automatically by the software. However, DAX for Power BI allows creating a measure using time functions to calculate the previous year sales.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1598373709032\"><strong class=\"schema-faq-question\">What are the options to calculate the previous year in DAX? <\/strong> <p class=\"schema-faq-answer\">In Power BI there are many options to calculate new measures, including the ones with time functions. Use the base column mapped from a table or other measures.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1598373727551\"><strong class=\"schema-faq-question\">What&#8217;s the difference between DAX and MDX languages? <\/strong> <p class=\"schema-faq-answer\">DAX stands for Data Analysis Expressions, and it&#8217;s used to create measures and calculations for Power BI and Power BI. For example, Analysis Services cubes contain MDX code.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1598373752771\"><strong class=\"schema-faq-question\">What is the DAX function for the last year?<\/strong> <p class=\"schema-faq-answer\">The DAX function to calculate the last year is the PREVIOUSYEAR built-in Power BI function, it returns all the dates till the year provided as an input parameter.<\/p> <\/div> <\/div>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/expert-only.com\/en\/power-bi\/power-bi-previous-month-value\/\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Power BI tutorial on how to use the SAMEPERIODLASTYEAR function in a DAX formula to calculate the last year value. To calculate the previous year value in a Power BI formula, simply use the two available DAX CALCULATE function <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\" title=\"How to calculate last year value in Power BI with DAX formulas?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":5514,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[446],"tags":[],"class_list":{"0":"post-8666","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-power-bi"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to calculate last year value in Power BI with DAX formulas?<\/title>\n<meta name=\"description\" content=\"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-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 calculate last year value in Power BI with DAX formulas?\" \/>\n<meta property=\"og:description\" content=\"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-19T04:33:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-19T13:57:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How to calculate last year value in Power BI with DAX formulas?\",\"datePublished\":\"2023-06-19T04:33:00+00:00\",\"dateModified\":\"2023-10-19T13:57:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\"},\"wordCount\":647,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg\",\"articleSection\":[\"Power BI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\",\"url\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\",\"name\":\"How to calculate last year value in Power BI with DAX formulas?\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg\",\"datePublished\":\"2023-06-19T04:33:00+00:00\",\"dateModified\":\"2023-10-19T13:57:22+00:00\",\"description\":\"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095\"},{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032\"},{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551\"},{\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to calculate last year value in Power BI with DAX formulas?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095\",\"position\":1,\"url\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095\",\"name\":\"Is the last year sales total calculated automatically in Power BI?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Per default, the total of last year sales are not calculated automatically by the software. However, DAX for Power BI allows creating a measure using time functions to calculate the previous year sales.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032\",\"position\":2,\"url\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032\",\"name\":\"What are the options to calculate the previous year in DAX?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"In Power BI there are many options to calculate new measures, including the ones with time functions. Use the base column mapped from a table or other measures.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551\",\"position\":3,\"url\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551\",\"name\":\"What's the difference between DAX and MDX languages?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"DAX stands for Data Analysis Expressions, and it's used to create measures and calculations for Power BI and Power BI. For example, Analysis Services cubes contain MDX code.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771\",\"position\":4,\"url\":\"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771\",\"name\":\"What is the DAX function for the last year?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"The DAX function to calculate the last year is the PREVIOUSYEAR built-in Power BI function, it returns all the dates till the year provided as an input parameter.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to calculate last year value in Power BI with DAX formulas?","description":"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.","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:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/","og_locale":"en_US","og_type":"article","og_title":"How to calculate last year value in Power BI with DAX formulas?","og_description":"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.","og_url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-06-19T04:33:00+00:00","article_modified_time":"2023-10-19T13:57:22+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How to calculate last year value in Power BI with DAX formulas?","datePublished":"2023-06-19T04:33:00+00:00","dateModified":"2023-10-19T13:57:22+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/"},"wordCount":647,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg","articleSection":["Power BI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/","url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/","name":"How to calculate last year value in Power BI with DAX formulas?","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg","datePublished":"2023-06-19T04:33:00+00:00","dateModified":"2023-10-19T13:57:22+00:00","description":"To calculate the last year value in Power BI and a DAX formula, use this code using CALCULATE and SAMEPERIODLASTYEAR functions combined.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095"},{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032"},{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551"},{"@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/02\/macro-1452987_1920.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to calculate last year value in Power BI with DAX formulas?"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095","position":1,"url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373676095","name":"Is the last year sales total calculated automatically in Power BI?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Per default, the total of last year sales are not calculated automatically by the software. However, DAX for Power BI allows creating a measure using time functions to calculate the previous year sales.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032","position":2,"url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373709032","name":"What are the options to calculate the previous year in DAX?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"In Power BI there are many options to calculate new measures, including the ones with time functions. Use the base column mapped from a table or other measures.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551","position":3,"url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373727551","name":"What's the difference between DAX and MDX languages?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"DAX stands for Data Analysis Expressions, and it's used to create measures and calculations for Power BI and Power BI. For example, Analysis Services cubes contain MDX code.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771","position":4,"url":"https:\/\/expert-only.com\/en\/power-bi\/last-year-value-dax-power-bi\/#faq-question-1598373752771","name":"What is the DAX function for the last year?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The DAX function to calculate the last year is the PREVIOUSYEAR built-in Power BI function, it returns all the dates till the year provided as an input parameter.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=8666"}],"version-history":[{"count":9,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8666\/revisions"}],"predecessor-version":[{"id":27549,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/8666\/revisions\/27549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/5514"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=8666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=8666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=8666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}