{"id":695,"date":"2021-04-29T09:23:00","date_gmt":"2021-04-29T13:23:00","guid":{"rendered":"http:\/\/www.markwheeler.com\/?p=695"},"modified":"2021-04-29T09:23:00","modified_gmt":"2021-04-29T13:23:00","slug":"power-bi-plan-vs-actual-line-charts","status":"publish","type":"post","link":"https:\/\/markwheeler.com\/?p=695","title":{"rendered":"Power BI: Plan vs Actual Line Charts"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"423\" class=\"wp-image-696\" style=\"width: 768px;\" src=\"http:\/\/www.markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed.png\" alt=\"\" srcset=\"https:\/\/markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed.png 1027w, https:\/\/markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed-300x165.png 300w, https:\/\/markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed-1024x564.png 1024w, https:\/\/markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed-768x423.png 768w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Request was to show a Running Total of Job Vacancies and Filled Vacancies by Target Date.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, I created a Calendar table: Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,12,31))<br>Second, I had to create a Running Total of Job Vacancies from Jan 1st thru the Target Date.<br><br>CountTotalRunning = CALCULATE(<br>&nbsp;&nbsp;&nbsp;&nbsp;COUNTA(&#8216;Vacancies'[ID]),<br>&nbsp;&nbsp;&nbsp;&nbsp;FILTER(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALLSELECTED(&#8216;Vacancies&#8217;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&#8216;Vacancies'[Need By Date] &lt;=MAX(&#8216;Calendar'[Date])<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br>)<br><br>Next, I had to create a Running Total of Job Vacancies that have been Filled to-date. The stumper was getting the Filled line to stop at Today&#8217;s date.<br><br>CountTotalOnboardToday = VAR x = CALCULATE(<br>&nbsp;&nbsp;&nbsp;&nbsp;COUNTA(&#8216;Vacancies'[ID]),<br>&nbsp;&nbsp;&nbsp;&nbsp;FILTER(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALLSELECTED(&#8216;Vacancies&#8217;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8216;Vacancies'[Status] = &#8220;Filled&#8221;<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br> )<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">RETURN<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">IF (MAX(&#8216;Calendar'[Date]) &gt; TODAY(),<br>&nbsp;&nbsp;&nbsp; BLANK(), x<br>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Request was to show a Running Total of Job Vacancies and Filled Vacancies by Target Date. First, I created a Calendar table: Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,12,31))Second, I had to create a Running Total of Job Vacancies from Jan 1st thru the Target Date. CountTotalRunning = CALCULATE(&nbsp;&nbsp;&nbsp;&nbsp;COUNTA(&#8216;Vacancies'[ID]),&nbsp;&nbsp;&nbsp;&nbsp;FILTER(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALLSELECTED(&#8216;Vacancies&#8217;),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&#8216;Vacancies'[Need By Date] &lt;=MAX(&#8216;Calendar'[Date])&nbsp;&nbsp;&nbsp;&nbsp;)) [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":696,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[83,84],"class_list":["post-695","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-power-bi","tag-power-bi-desktop"],"jetpack_featured_media_url":"https:\/\/markwheeler.com\/wp-content\/uploads\/2021\/04\/onboardvsneed.png","_links":{"self":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=695"}],"version-history":[{"count":0,"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/695\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/media\/696"}],"wp:attachment":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}