{"id":15786,"date":"2019-08-23T13:23:21","date_gmt":"2019-08-23T20:23:21","guid":{"rendered":"https:\/\/devwww.3cloudsolutions.com\/post\/the-art-of-the-disconnected-table-3\/"},"modified":"2024-01-08T10:54:17","modified_gmt":"2024-01-08T18:54:17","slug":"the-art-of-the-disconnected-table","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/the-art-of-the-disconnected-table\/","title":{"rendered":"The Art of the Disconnected Table"},"content":{"rendered":"<p>(This topic was the Use Case example shown during our <a href=\"https:\/\/bluegranite.wistia.com\/medias\/zrzd87xawg\" rel=\" noopener\">August 2019 session of Power BI Office Hours<\/a>.)<\/p>\n<p>As this is a long blog article there are the relevant sections:<\/p>\n<p style=\"line-height: 1;\"><a href=\"#overview\/requirements\" rel=\" noopener\">Overview\/Requirements<\/a><\/p>\n<p style=\"line-height: 1;\"><a href=\"#Time_Intelligence_Measures\" rel=\" noopener\">Time Intelligence Measures<\/a><\/p>\n<p style=\"line-height: 1;\"><a href=\"#Creating_the_Disconnected_Date_table\" rel=\" noopener\">Creating the Disconnected Date table<\/a><\/p>\n<p style=\"line-height: 1;\"><a href=\"#Creating_the_Calculated_Measures\" rel=\" noopener\">Creating the Calculated Measures<\/a><\/p>\n<p style=\"line-height: 1;\"><a href=\"#Refining_the_KPI_Card_Measures\" rel=\" noopener\">Refining the KPI Card Measures<\/a><\/p>\n<h2><a id=\"Overview\/requirements\"><\/a><span style=\"color: #58595b;\">Overview\/Requirements\u00a0<\/span><\/h2>\n<p><span style=\"color: #58595b;\">I was out on the interwebs the other day and there was a request on the PowerBI User Group:<\/span><\/p>\n<p><span style=\"color: #58595b;\">\u201cSo I&#8217;m working on a report and I need to be able to see the MTD and YTD of sales for a selected date. I also need a graph showing the sales of each day in the month of the selected day up to that day. These will be on separate pages so I do have the date slicer already synced but I threw the visual one page for simplicity&#8217;s sake. Any advice? Right now I can only get visuals to show for the selected day.\u201d<\/span><\/p>\n<p><span style=\"color: #58595b;\">For this blog post we\u2019ll set the requirements as such:<\/span><\/p>\n<ul>\n<li><span style=\"color: #58595b;\">One (1) slicer that has a list of dates<\/span><\/li>\n<li><span style=\"color: #58595b;\">Three (3) KPI cards that reflect the daily, MTD, and YTD sales for the value selected in the slicer.<\/span><\/li>\n<li><span style=\"color: #58595b;\">One (1) clustered column chart that lists the MTD values by date from the beginning of the month of the date selected up-to-and-including the date selected.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #58595b;\">Something that looks like this:<\/span><\/p>\n<p><img decoding=\"async\" style=\"width: 1223px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/Disconnected%20table%20power%20bi%201.png\" alt=\"Disconnected table power bi 1\" width=\"1223\" \/><\/p>\n<p><span style=\"color: #58595b;\">And for extra credit we\u2019ll make the titles above the cards dynamic as well.\u00a0 <\/span><\/p>\n<p><span style=\"color: #58595b;\">How did I accomplish that?\u00a0 The answer \u2013 <strong>disconnected tables<\/strong>.\u00a0<\/span><\/p>\n<p><span style=\"color: #58595b;\">Why?<\/span><\/p>\n<p><span style=\"color: #58595b;\">Well, think about what\u2019s happening behind the scenes if I have the following dataset:<\/span><\/p>\n<p><img decoding=\"async\" style=\"width: 270px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%202.png\" alt=\"disconnected table power bi 2\" width=\"270\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Time Intelligence Measures<\/h2>\n<p>Imagine that I throw a slicer on the page with Date and then create the calculated measures for Daily Sales, MTD Sales, and YTD Sales.\u00a0 These will all function just fine.<\/p>\n<p style=\"line-height: 1;\"><img decoding=\"async\" style=\"width: 1002px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%203.png\" alt=\"disconnected table power bi 3\" width=\"1002\" \/><\/p>\n<p>Here\u2019s the code for the 3 calculated measures:<\/p>\n<p>Daily Sales = SUM(Sales[Sales Amount])<\/p>\n<p>MTD Sales = TOTALMTD([Daily Sales], Sales[Date])<\/p>\n<p>YTD Sales = TOTALYTD([Daily Sales], Sales[Date])<\/p>\n<p>However, the moment I try to add the clustered column chart and use Daily Sales as my measure what happens?\u00a0 It only displays the data for the one date selected in the slicer.\u00a0 How can I get it to display all the dates up <em>thru<\/em> the date I\u2019ve selected in the slicer?\u00a0 Sadly, as long as they both come from the same Date field they will always both have the same Filter Context.\u00a0 Enter the disconnected table.<\/p>\n<p>I use disconnected tables when I want to drive a slicer by one set of values and use the value(s) selected to then control what is displayed.<\/p>\n<p>Here\u2019s the technique I\u2019m going to use:<\/p>\n<ol>\n<li>Create a date table to drive the slicer \u2013 I\u2019ll leave it disconnected from the fact table.<\/li>\n<li>Create a calculated measure that looks at the date selected in the slicer and determines if a value should be calculated.<\/li>\n<li>Use that calculated measure in my chart.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>Creating the Disco<span style=\"color: #58595b;\">nnected Dat<\/span>e table<\/h2>\n<p>There are a few different ways I could create my date table \u2013 I could reimport the source file, select just the Date column, and remove duplicate rows.\u00a0 But that\u2019s too much work.\u00a0 Enter one of my favorite DAX function: CALENDARAUTO().<\/p>\n<p>The CALENDARAUTO() function scans all Date\/DateTime\/Time columns <em>in your entire model<\/em>, goes to Jan\u00a0 1 of the earliest date it finds and Dec 31 of the latest date it finds and returns a table of dates with all dates in-between.\u00a0 All with very little typing.<\/p>\n<p>So, I\u2019ll click the \u201cNew Table\u201d button in the Modeling menu in the toolbar and replace the \u201cTable = \u201c with \u201cDisconnected Date = CALENDARAUTO()\u201d.\u00a0 Presto \u2013 magic date table.<\/p>\n<p>**Note: I want to reiterate what the CALENDARAUTO() function returns \u2013 it looks at <em>all<\/em> dates\/datetimes in your model.\u00a0 So if you have fields like date-of-birth or defaults that set null dates to, say, 1\/1\/1900 you may want to use a different technique so you don\u2019t have a Date table that goes from 1\/1\/1900 \u2013 12\/31\/2031.\u00a0 But for this example it will suffice.**<\/p>\n<p>**Important: do not create a relationship between the date table and the fact table \u2013 in fact double-check and make sure the engine didn\u2019t try to create one for you.**<\/p>\n<p><img decoding=\"async\" style=\"width: 798px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%204.png\" alt=\"disconnected table power bi 4\" width=\"798\" \/><\/p>\n<h2><a>Creating the Calculated Measures<\/a><\/h2>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Ok \u2013 next step \u2013 the calculated measures.\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\">There are a number of functions that determine if something has been selected in a table: HASONEVALUE(), ISFILTERED(), SELECTEDVALUE(), etc.\u00a0 I chose to use SELECTEDVALUE() in this scenario.<\/span><\/p>\n<p><span style=\"color: #000000;\">We\u2019ll start easy and then refine it.<\/span><\/p>\n<p><span style=\"color: #000000;\">First we\u2019ll start with the code that says \u201csum up Sales Amount for any day prior to the date I\u2019ve selected in the slicer\u201d.<\/span><\/p>\n<p><span style=\"color: #000000;\">How do I know what date I\u2019ve selected in the slicer?\u00a0 SELECTEDVALUE().\u00a0 Let\u2019s see it in action.<\/span><\/p>\n<p><span style=\"color: #000000;\">I\u2019ll create a calculated measure in my Disconnected Date table called \u201cSelected Date\u201d.\u00a0 Here\u2019s the DAX:<\/span><\/p>\n<p><span style=\"color: #000000;\">Selected Date = SELECTEDVALUE(&#8216;Disconnected Date'[Date])<\/span><\/p>\n<p><span style=\"color: #000000;\">I\u2019ll add that calculated measure to a card on my report canvas and create a new slicer with the Date column from the Disconnected Date table (leave the other one on the page if you\u2019re working along with me).<\/span><\/p>\n<p><span style=\"color: #000000;\">As I select different values in the new slicer note that the \u201cSelected Date\u201d measure changes to reflect the date selected.\u00a0 Perfect.<\/span><\/p>\n<p><span style=\"color: #000000;\">**Note: The SELECTEDVALUE() function has an optional second argument \u2013 we will use MAX(\u2018Disconnected Date\u2019[Date]) as the second argument in the event the user multi-selects two or more dates in the slicer.**<\/span><\/p>\n<p><img decoding=\"async\" style=\"width: 745px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/Disconnected%20table%20power%20bi%205.png\" alt=\"Disconnected table power bi 5\" width=\"745\" \/><\/p>\n<p><span style=\"color: #000000;\">Ok \u2013 now the hard part.\u00a0 Creating the calculated measure that looks at that \u201cSelected Date\u201d value and figures out if the engine should calculate a value.<\/span><\/p>\n<p><span style=\"color: #000000;\">Here\u2019s the logic: \u201cif the user selects a date in the slicer then calculate the MTD sales for any date on-or-before the date selected and in the same month as the date selected\u201d.<\/span><\/p>\n<p><span style=\"color: #000000;\">Here\u2019s the DAX that does that work:<\/span><\/p>\n<p><span style=\"color: #000000;\"><em>(formatting provided by DaxFormatter.com \u2013 thanks SQLBI.com guys!)<\/em><\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">Rolling MTD Sales =<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">CALCULATE (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0 [Daily Sales],<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0 FILTER (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL ( Sales[Date] ),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Sales[Date] &lt;= [Selected Date]<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; MONTH ( Sales[Date] ) = MONTH ( [Selected Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; YEAR ( Sales[Date] ) = YEAR ( [Selected Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; Sales[Date] &lt;= MAX ( Sales[Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">\u00a0\u00a0\u00a0 )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier; color: #000000;\">)<\/span><\/p>\n<p><span style=\"color: #000000;\">So, what does that do?\u00a0 Well, we know [Daily Sales] is simply SUM(Sales[Sales Amount]).\u00a0 The FILTER() function then filters the Sales table, clearing any context on the Date column using the ALL() function, and then applies a new filter saying \u201cwhere the Sales[Date] column is less-than-or-equal-to the Date selected in the Disconnected Date slicer and has the same Month and Year as the Date selected\u201d.\u00a0 Why do we need that last \u201c&amp;&amp; Sales[Date] &lt;= MAX(Sales[Date])\u201d?\u00a0 Because the left-hand side of that argument is the value of the Date column in the filtered table (essentially \u201cinside\u201d the FILTER function) and the MAX(Sales[Date]) references the outer context in my visualization (essentially \u201coutside\u201d the FILTER function).<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a id=\"Overview\/requirements\"><\/a><span style=\"color: #000000;\">(Note: if you want to learn more about evaluation context I encourage you to check out this great video on SQLBI.com: <a style=\"color: #000000;\" href=\"https:\/\/www.sqlbi.com\/tv\/deep-dive-into-dax-evaluation-context\/?nu=19529\">https:\/\/www.sqlbi.com\/tv\/deep-dive-into-dax-evaluation-context\/?nu=19529<\/a>)<\/span><\/p>\n<p><span style=\"color: #000000;\">If I add my new [Rolling MTD Sales] measure to a clustered column chart let\u2019s see what happens.\u00a0 The magic here: I\u2019m using the Date column from my <em>Sales<\/em> table.<\/span><\/p>\n<p><span style=\"color: #000000;\">So what\u2019s going on there?<\/span><\/p>\n<p><span style=\"color: #000000;\">Can you see that slight \u201clean\u201d at the front of that chart?\u00a0 We\u2019re accurately calculating the MTD (if I hover over one of the points in the far left of the chart the tooltip returns the correct MTD value) but I\u2019m then showing that value for the rest of time.\u00a0 Let\u2019s clean that up:<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">Rolling MTD Sales =<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">IF (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 OR (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ISFILTERED ( &#8216;Disconnected Date'[Date] ) = FALSE (),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MAX ( Sales[Date] ) &gt; [Selected Date]<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 ),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 BLANK (),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 CALCULATE (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [Daily Sales],<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 FILTER (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL ( Sales[Date] ),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Sales[Date] &lt;= [Selected Date]<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; MONTH ( Sales[Date] ) = MONTH ( [Selected Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; YEAR ( Sales[Date] ) = YEAR ( [Selected Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; Sales[Date] &lt;= MAX ( Sales[Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">)<\/span><\/p>\n<p>I\u2019ve added a new IF() function at the beginning saying \u201cif the user hasn\u2019t selected a value in the Disconnected Date table OR the Date that we\u2019re looking at in the visualization is greater than the date selected in the Disconnected Date table return a BLANK() otherwise do the math\u201d.<\/p>\n<p><img decoding=\"async\" style=\"width: 918px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%207.png\" alt=\"disconnected table power bi 7\" width=\"918\" \/><\/p>\n<p>That looks a LOT better.\u00a0 If I select another date it does exactly what I want.<\/p>\n<p><img decoding=\"async\" style=\"width: 878px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%208.png\" alt=\"disconnected table power bi 8\" width=\"878\" \/><\/p>\n<h2>Refining the KPI Card Measures<\/h2>\n<p>Lastly I need to get those KPI cards working.\u00a0 They\u2019re currently not \u201chooked up\u201d to the Disconnected Date slicer.<\/p>\n<p>The Daily Sales one is pretty easy to solve.<\/p>\n<p>Rolling Daily Sales = CALCULATE([Daily Sales], FILTER(Sales, Sales[Date] = [Selected Date]))<\/p>\n<p>The MTD values is a little trickier.\u00a0 If I try to use [Rolling MTD Sales] in a KPI card it\u2019ll return a Blank.\u00a0 Why?\u00a0 Because in the KPI Card the Sales[Date] column has no context so the MTD DAX doesn\u2019t know what date to use.<\/p>\n<p>We can use the same technique as above with one little tweak:<\/p>\n<p>Rolling MTD Sales Card = CALCULATE([Rolling MTD Sales], FILTER(Sales, Sales[Date] &lt;= [Selected Date]))<\/p>\n<p>I have to use \u201c&lt;=\u201d so that I don\u2019t focus the context on the Sales[Date] to just one date (try it \u2013 watch what happens if you use just \u201c=\u201d).<\/p>\n<p>And then for the YTD card I\u2019ll create a [YTD Rolling Sales] calculated measure and then another [YTD Rolling Sales Card] measure to use in the KPI card.<\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">Rolling YTD Sales =<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">IF (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 OR (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ISFILTERED ( &#8216;Disconnected Date'[Date] ) = FALSE (),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MAX ( Sales[Date] ) &gt; [Selected Date]<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 ),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 BLANK (),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 CALCULATE (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [Daily Sales],<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 FILTER (<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ALL ( Sales[Date] ),<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Sales[Date] &lt;= [Selected Date]<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; YEAR ( Sales[Date] ) = YEAR ( [Selected Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; Sales[Date] &lt;= MAX ( Sales[Date] )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">\u00a0\u00a0\u00a0 )<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">)<\/span><\/p>\n<p>Voila!<\/p>\n<p><img decoding=\"async\" style=\"width: 1316px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%209.png\" alt=\"disconnected table power bi 9\" width=\"1316\" \/><\/p>\n<p>If you\u2019re interested, here\u2019s the code to generate a few Dynamic Titles.<\/p>\n<p>(You can find a great blog article on dynamic titles by Lindsay Pinchot <a href=\"https:\/\/www.blue-granite.com\/blog\/create-a-dynamic-title-in-power-bi-updated\">here<\/a>).<\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">Rolling Daily Sales Title = &#8220;Daily sales for &#8221; &amp; FORMAT([Selected Date], &#8220;M\/d\/yy&#8221;)<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">Rolling MTD Sales Title = &#8220;MTD Sales for &#8221; &amp; FORMAT([Selected Date], &#8220;MMM yy&#8221;)<\/span><\/p>\n<p style=\"line-height: 1; font-size: 12px;\"><span style=\"font-family: 'courier new', courier;\">Rolling YTD Sales Title = FORMAT([Selected Date], &#8220;yyyy&#8221;) &amp; &#8221; YTD Sales&#8221;<\/span><\/p>\n<p><img decoding=\"async\" style=\"width: 848px;\" src=\"https:\/\/cdn2.hubspot.net\/hubfs\/257922\/disconnected%20table%20power%20bi%2010.png\" alt=\"disconnected table power bi 10\" width=\"848\" \/><\/p>\n<p>If you have further questions please don\u2019t hesitate to <a href=\"\/get-started\/\">Contact Us<\/a>\u00a0and we\u2019ll be happy to help!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using disconnected tables in Power BI &#8211; An  overview from 3Cloud\\&#8217;s August session of Power BI Office Hours<\/p>\n","protected":false},"author":21,"featured_media":13247,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[305,273],"class_list":["post-15786","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-modern-bi","tag-power-bi","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=15786"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15786\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/13247"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=15786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=15786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=15786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}