{"id":3957,"date":"2022-03-11T09:17:21","date_gmt":"2022-03-11T17:17:21","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3957"},"modified":"2022-03-11T09:17:23","modified_gmt":"2022-03-11T17:17:23","slug":"how-to-use-dateadd-to-generate-comparisons-over-a-range-of-different-time-frames","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3957","title":{"rendered":"How to Use DATEADD\u00a0to Generate Comparisons Over a Range of Different Time Frames"},"content":{"rendered":"\n<p><em>DATEADD<\/em>&nbsp;is a flexible and powerful DAX function. DATEADD takes in a date column, the offset, and the time interval for the offest. The offset is the number of intervals to go forward or back in time.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"example-formulas\">Example Formulas:<\/h6>\n\n\n\n<pre class=\"wp-block-preformatted\">Rev Previous_Day =\nCALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,DAY)\n\nRev Previous_Month = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,MONTH))\n\t           \nRev Previous_Quarter = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,QUARTER)     <\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Rev Previous_Year = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,YEAR))<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DATEADD&nbsp;is a flexible and powerful DAX function. DATEADD takes in a date column, the offset, and the time interval for the offest. The offset is the number of intervals to go forward or back in time. Example Formulas: Rev Previous_Day = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,DAY) Rev Previous_Month = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,MONTH)) Rev Previous_Quarter = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,QUARTER) Rev Previous_Year = CALCULATE(SUM(TransactionData[Revenue]),DATEADD(CalenderDate[Date],-1,YEAR))<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,621],"tags":[1072,1073],"class_list":["post-3957","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-power-bi","tag-dateadd","tag-dateadd-power-bi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3957"}],"version-history":[{"count":3,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3957\/revisions"}],"predecessor-version":[{"id":4073,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3957\/revisions\/4073"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}