<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Daily total of slowly changing dimension 2 table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062224#M46554</link>
    <description>&lt;P&gt;This article is covering the CROSSFILTER(,,,None) scenario&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax/" target="_blank"&gt;Bidirectional relationships and ambiguity in DAX - SQLBI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, really, it does.&amp;nbsp; It's a long read but totally worth it.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 15:55:23 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2021-09-07T15:55:23Z</dc:date>
    <item>
      <title>Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2057077#M46361</link>
      <description>&lt;P&gt;Main question -&amp;nbsp;Is there a way to create a measure that tracks the total number of people assigned to each value at every given point in time between dates of a date slicer, when that info is stored in a slowly changing dimension 2 table where only changes are recorded with its valid date range?&lt;/P&gt;&lt;P&gt;I have a SCD2 table.&amp;nbsp;&lt;SPAN&gt;In my table is an Id, Value, Category, begin and end dates in which the Value assignment is valid. Customers may have many records in this table due to many changes to their history, or just one if they haven't been recategorized at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;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&gt;7&lt;/TD&gt;&lt;TD&gt;3/3/2017&lt;/TD&gt;&lt;TD&gt;8/25/2021&lt;/TD&gt;&lt;TD&gt;M1&lt;/TD&gt;&lt;TD&gt;MG&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;12/31/2020&lt;/TD&gt;&lt;TD&gt;3/1/2017&lt;/TD&gt;&lt;TD&gt;Former M_Pool&lt;/TD&gt;&lt;TD&gt;NULL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;3/2/2017&lt;/TD&gt;&lt;TD&gt;8/25/2021&lt;/TD&gt;&lt;TD&gt;M3&lt;/TD&gt;&lt;TD&gt;MLD&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I've created running totals before, but this is a bit different since at the beginning of my date slicer I'll need to capture who is where at that point in time, as well as where everyone is at each day as they drop in and out of the different values.&lt;/P&gt;&lt;P&gt;Right now, I'll I've been able to create is a measure and chart that captures how many changes were made to each category on the date of the change, using the below DAX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RT M3 = 
var MinDate = CALCULATE(MIN(DimDate[Date]), ALLSELECTED(DimDate))
var MaxDate = CALCULATE(MAX(DimDate[Date]), ALLSELECTED(DimDate))
return
CALCULATE(
	DISTINCTCOUNT('M Pool History'[CustomerId]),
    FILTER('M Pool History','M Pool History'[Begin Date] &amp;lt;= MaxDate),
    FILTER('M Pool History','M Pool History'[End Date] &amp;gt;= MinDate),
    VALUES('M Pool History'[M Pool Value])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Producing results like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My data model relates the SCD2 table to a Date Dimension table, with the active relationship between Begin Date and Date, and inactive relationship between End Date and Date&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Ideas? The only one I have right now is by brute forcing the SCD2 table into having a record for each customer for each date in scope with what category they had at that time, but that would result in 20M+ rows, and would only grow over time.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 22:03:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2057077#M46361</guid>
      <dc:creator>jtspilker</dc:creator>
      <dc:date>2021-09-03T22:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2058275#M46415</link>
      <description>&lt;P&gt;Possible approaches would be to use a dedicated disconnected calendar table or to use the CROSSFILTER(,,,none) pattern.&amp;nbsp; You'll have to test the performance though.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2021 01:11:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2058275#M46415</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-06T01:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062189#M46552</link>
      <description>&lt;P&gt;Thanks. Do you have examples for either of these methods or be willing to give a brief description of how these could be implemented? I'm unfamiliar with either approach of using a disconnected calendar table or the CROSSFILTER function.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 15:41:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062189#M46552</guid>
      <dc:creator>jtspilker</dc:creator>
      <dc:date>2021-09-07T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062224#M46554</link>
      <description>&lt;P&gt;This article is covering the CROSSFILTER(,,,None) scenario&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax/" target="_blank"&gt;Bidirectional relationships and ambiguity in DAX - SQLBI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, really, it does.&amp;nbsp; It's a long read but totally worth it.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 15:55:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062224#M46554</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-07T15:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062349#M46560</link>
      <description>&lt;P&gt;Interesting article!&lt;/P&gt;&lt;P&gt;I think I'm following what the CROSSFILTER can do, but not sure how that would help me in this scenario. I want to track the total people assigned a particular value through time, so how does disconnecting the Value history from the date get me closer to achieving that?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 17:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062349#M46560</guid>
      <dc:creator>jtspilker</dc:creator>
      <dc:date>2021-09-07T17:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062412#M46561</link>
      <description>&lt;P&gt;It will allow you to create a cartesian product between dates and people, and then you can create a measure that calculates your desired value for each combination of person and date. Or a measure that calculates the total people assigned to a particular value over time.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 17:53:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062412#M46561</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-07T17:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062568#M46567</link>
      <description>&lt;P&gt;Gotcha. So if I'm understanding correctly, I'll still be creating a table that has every customer and their assigned value at every date in my range? I was hesitant to do that because of the large number of rows this would create and was hoping there was some DAX available that would forgo that.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 19:44:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062568#M46567</guid>
      <dc:creator>jtspilker</dc:creator>
      <dc:date>2021-09-07T19:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062606#M46569</link>
      <description>&lt;P&gt;No, there's no workaround in DAX (that I am aware of).&amp;nbsp; If you are concerned about the volumes you may need to do the computations further upstream. Power BI has no memory and what DAX calls variables are actually constants that only live inside the (row) context.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 20:11:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062606#M46569</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-07T20:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062632#M46571</link>
      <description>&lt;P&gt;Thanks for the discussion, lbendlin!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 20:22:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062632#M46571</guid>
      <dc:creator>jtspilker</dc:creator>
      <dc:date>2021-09-07T20:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Daily total of slowly changing dimension 2 table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062728#M46575</link>
      <description>&lt;P&gt;Likewise.&amp;nbsp; Here's to hoping that Microsoft will respond in kind to Qlik's CDC advancements and implement some features for event based reporting. That would obviate the need for these snapshot gymnastics.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 21:20:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Daily-total-of-slowly-changing-dimension-2-table/m-p/2062728#M46575</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-07T21:20:12Z</dc:date>
    </item>
  </channel>
</rss>

