<?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: Calculate running backlog based on two fact tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2351908#M59736</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, thanks for the tips!&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;&lt;SPAN&gt;CONCATENATEX to figure out what was happening in each CALCULATETABLE. I eventually got the following to work, though I'm still not entirely sure why I have to include ALL in each CALCULATETABLE, which leads me to believe there's probably a more elegant solution.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Backlog = 

var MaxDate = //Get the latest date from the Week of Year context
    MAX('Calendar'[Date]) 

var TemplatedJobs = //Get JobIDs of Templated Jobs thus far
    CALCULATETABLE(
        SUMMARIZE(
            Template,
            Job_Info[JobID]
        ),
        Template[Template Date] &amp;lt;= MaxDate, 
        ALL(Template)
    )

var InstalledJobs = //Get JobIDs of Installed Jobs thus far
    CALCULATETABLE(
        SUMMARIZE(
            Install,
            Job_Info[JobID]
        ),
        Install[Install Date] &amp;lt;= MaxDate,
        ALL(Install)
    )

var Backlog = //Get JobIDs of jobs that have been Templated but not Installed
    EXCEPT(
        TemplatedJobs,
        InstalledJobs
    )

Return  //Sum the Sqft of those jobs
    CALCULATE(
        [Templated Footage], //= SUM(Template[SqFt])
        Template[JobID] IN Backlog,
        ALL(Template)
    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Feb 2022 20:43:36 GMT</pubDate>
    <dc:creator>abaulo</dc:creator>
    <dc:date>2022-02-21T20:43:36Z</dc:date>
    <item>
      <title>Calculate running backlog based on two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2340083#M59027</link>
      <description>&lt;P&gt;Hello everyone!&lt;BR /&gt;I'm still getting my bearings with DAX and Data Modeling, so I'm unsure how to phrase the question.&lt;BR /&gt;I've tried wording it many ways to find an existing solution to no avail. Even if you're input is a link to the appropriate forum post, it would be very much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've stripped down the tables for sharing the basic structure of the data.&lt;/P&gt;&lt;P&gt;Here is a link to the file:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/15pkuS2kgcxPINkfKLXjUHQoED_NX6DU-/view?usp=sharing" target="_blank" rel="noopener"&gt;Sample file&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/15pkuS2kgcxPINkfKLXjUHQoED_NX6DU-/view?usp=sharing" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Template table&amp;nbsp;&lt;SPAN&gt;records trips to the job site to measure/draw the fabrication template.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Install table records installation trips to the job site.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find a way to sum the square footage from the Template table for Jobs that:&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Have a Template date &amp;lt;= date context&lt;/LI&gt;&lt;LI&gt;Do not have an Install date &amp;lt;= date context&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I'm calling this the "Backlog" of footage that needs to be installed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Backlog =
VAR MaxDate =
    //Get the latest date from the Week of Year context
    MAX ( 'Calendar'[Date] )
VAR TemplatedJobs =
    //Get JobIDs of Templated Jobs thus far
    CALCULATETABLE (
        SUMMARIZE (
            Template,
            Job_Info[JobID]
        ),
        Template[Template Date] &amp;lt;= MaxDate
    )
VAR InstalledJobs =
    //Get JobIDs of Installed Jobs thus far
    CALCULATETABLE (
        SUMMARIZE (
            Install,
            Job_Info[JobID]
        ),
        Install[Install Date] &amp;lt;= MaxDate
    )
VAR TemplatedNotInstalled =
    //Get JobIDs of jobs that have been Templated but not Installed
    EXCEPT (
        TemplatedJobs,
        InstalledJobs
    )
RETURN
    //Sum the Sqft of those jobs
    CALCULATE (
        [Templated Footage], //= SUM(Template[SqFt])
        TemplatedNotInstalled
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm expecting to see the Backlog footage change from week to week as installs happen, but so far it is just matching the Templated Footage measure:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Though the "Total" seems to be correct...so that's a start.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get the individual weeks to show the correct Backlog?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any assistance you can provide!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 20:22:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2340083#M59027</guid>
      <dc:creator>abaulo</dc:creator>
      <dc:date>2022-02-16T20:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running backlog based on two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2345718#M59330</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="359309" data-lia-user-login="abaulo" class="lia-mention lia-mention-user"&gt;abaulo&lt;/a&gt;&amp;nbsp;I don't see anything obviously wrong with the calculation. I will have to pull down the file and take a closer look. What you can do is to change your RETURN statement to make sure the individual parts of the formula are correct, like returning MaxDate. You can also use CONCATENATEX against your table variables to "look inside" those tables and see what they contain and if they contain the correct things.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 18:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2345718#M59330</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-02-17T18:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running backlog based on two fact tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2351908#M59736</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, thanks for the tips!&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;&lt;SPAN&gt;CONCATENATEX to figure out what was happening in each CALCULATETABLE. I eventually got the following to work, though I'm still not entirely sure why I have to include ALL in each CALCULATETABLE, which leads me to believe there's probably a more elegant solution.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Backlog = 

var MaxDate = //Get the latest date from the Week of Year context
    MAX('Calendar'[Date]) 

var TemplatedJobs = //Get JobIDs of Templated Jobs thus far
    CALCULATETABLE(
        SUMMARIZE(
            Template,
            Job_Info[JobID]
        ),
        Template[Template Date] &amp;lt;= MaxDate, 
        ALL(Template)
    )

var InstalledJobs = //Get JobIDs of Installed Jobs thus far
    CALCULATETABLE(
        SUMMARIZE(
            Install,
            Job_Info[JobID]
        ),
        Install[Install Date] &amp;lt;= MaxDate,
        ALL(Install)
    )

var Backlog = //Get JobIDs of jobs that have been Templated but not Installed
    EXCEPT(
        TemplatedJobs,
        InstalledJobs
    )

Return  //Sum the Sqft of those jobs
    CALCULATE(
        [Templated Footage], //= SUM(Template[SqFt])
        Template[JobID] IN Backlog,
        ALL(Template)
    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 20:43:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-backlog-based-on-two-fact-tables/m-p/2351908#M59736</guid>
      <dc:creator>abaulo</dc:creator>
      <dc:date>2022-02-21T20:43:36Z</dc:date>
    </item>
  </channel>
</rss>

