<?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: Running Decrement based on two values from 3 related tables. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4085357#M162148</link>
    <description>&lt;P&gt;Hi Dangar,&lt;/P&gt;&lt;P&gt;Unfortunately your solution doesn't take into account that the Stack Rank (Raw), Capacity and Total Demand fields all come from different (but related) tables and the ALL function only allows fields from the same table. Modifying your formula to include the actual table names as noted above, this is what it looks like:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Capacity = var a = SUMX(FILTER(ALL('Projects'[Stack Rank (Raw)],'ResourceTimephasedDataSet'[Capacity]),'Projects'[Stack Rank (Raw)]=1),'ResourceTimephasedDataSet'[Capacity]) var b = MAXX(FILTER(ALL('Projects'[Stack Rank (Raw)]),'Projects'[Stack Rank (Raw)]&lt;/LI-CODE&gt;&lt;P&gt;The error message thrown is:&lt;/P&gt;&lt;P&gt;"All column arguments of the ALL/ALLNOBLANKROW/ALLSELECTED/REMOVEFILTERS function must be from the same table."&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2024 23:19:43 GMT</pubDate>
    <dc:creator>Gabe_V1</dc:creator>
    <dc:date>2024-08-06T23:19:43Z</dc:date>
    <item>
      <title>Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4076599#M161871</link>
      <description>&lt;P&gt;In Power BI I have a table-style visualization which uses a field called "AssignmentWork" from a table caled "AssignmentTimephasedDataSet", a field called "Capacity" and a field called "UtilizationPercentage" from a table called "ResourceTimephasedDataSet", and a sortation field called "Stack Rank (Raw)" from a table called "Projects". Currently the "Capacity" and "UtilizationPercentage" columns are just static columns. However, I would like the "Capacity" column in the visual (which we'll call "Running Capacity") to decrement by "AssignmentWork", and "UtilizationPercentage" to increase by "AssignmentWork". The starting value of the new "Running Capacity" column should be the "Capacity" value corresponding to the lowest shown value in the "Stack Rank (Raw)" column in the visual (noting that rows may be filtered out of the visual, but the "Stack Rank (Raw)" column values will always be in ascending order, as per the example below)&lt;/P&gt;&lt;P&gt;I made a stab at a DAX calculated column for running decremented capacity (modified from some other code I found in another forum), but I'm a DAX newbie, and when I run it, it doesn't actually return anything, and I am having a hard time figuring out how to make it work given the relationships of the tables needed. From other articles I've read, there may be a better way to do this as a measure instead of a calculated column, but I'm not sure how to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sincerely appreciate any help you can provide! Thanks!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The source for these columns is:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;Total Demand: Sum of 'AssignmentTimephasedDataSet'[AssignmentWork]&lt;BR /&gt;Capacity: Sum of 'ResourceTimephasedDataSet'[Capacity]&lt;BR /&gt;Utilization: 'ResourceTimephasedDataSet'[UtilizationPercentage]&lt;BR /&gt;Stack Rank: Sum of 'Projects'[Stack Rank (Raw)]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;These tables are related in the data model as follows:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;Projects-&amp;gt;1:M-&amp;gt;AssignmentTimephasedDataSet on ProjectUID&lt;BR /&gt;ResourceTimephasedDataSet is related to AssignmentTimephasedDataSet by way of a Resources table intermediary as follows:&lt;BR /&gt;ResourceTimephasedDataSet-&amp;gt;M:1-&amp;gt;Resources on ResourceUID&lt;BR /&gt;Resources-&amp;gt;1:M-&amp;gt;AssignmentTimephasedDataSet on ResourceUID&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Visual Representation of the table relationships:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the code I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Capacity = 
VAR _SelResUID = SELECTEDVALUE(AssignmentTimephasedDataSet[ResourceUID])
VAR _SelStackRank = SELECTEDVALUE('Projects'[Stack Rank (Raw)])
VAR _CapQty = SELECTCOLUMNS(FILTER('ResourceTimephasedDataSet', 'ResourceTimephasedDataSet'[ResourceUID] = _SelResUID), "@ResourceTimephasedDataSet", 'ResourceTimephasedDataSet'[Capacity])
VAR _SumQty = CALCULATE( SUM(AssignmentTimephasedDataSet[AssignmentWork]), REMOVEFILTERS(), SUMMARIZE(AssignmentTimephasedDataSet, AssignmentTimephasedDataSet[ResourceUID]), 'Projects'[Stack Rank (Raw)] &amp;lt;= _SelStackRank)
RETURN _CapQty - _SumQty&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my current outcome:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is my desired outcome&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:06:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4076599#M161871</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-09T20:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4077107#M161903</link>
      <description>&lt;P&gt;A short in dark&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Capacity = 

VAR _CurrentStackRank = SELECTEDVALUE('Projects'[Stack Rank (Raw)])
VAR _SelResUID= SELECTEDVALUE(AssignmentTimephasedDataSet[ResourceUID])

VAR _CapQty = 
    CALCULATE(
        SUM('ResourceTimephasedDataSet'[Capacity]),
        FILTER(
            ALL('ResourceTimephasedDataSet'),
            'ResourceTimephasedDataSet'[ResourceUID] = _SelResUID
        )

VAR _StackRank =
    OFFSET(
        -1,
        ALLSELECTED('Projects'),
        ORDERBY('Projects'[Stack Rank (Raw)], ASC)
    )

VAR _SumQty = 
    CALCULATE(
        SUM(Projects[TotalDemand]),
	FILTER(ALL(Projects),'Projects'[Stack Rank (Raw)] &amp;lt;= _StackRank)
        
    )

RETURN _CapQty - _SumQty&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 03 Aug 2024 06:45:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4077107#M161903</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-03T06:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4081595#M162032</link>
      <description>Hi SachinNandanwar, Thank you for your help. I think it is closer, just by looking at it. I changed the SUM field reference in the _SumQty variable from Projects[TotalDemand] to AssignmentTimephasedDataSet[AssignmentWork] because "TotalDemand" is just the front end name on the report, and actually refers to AssignmentTimephasedDataSet[AssignmentWork]. However, now I get this error: "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value." Any thoughts?</description>
      <pubDate>Mon, 05 Aug 2024 14:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4081595#M162032</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-05T14:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4083506#M162089</link>
      <description>&lt;P&gt;Please share some sample data or the PBI file.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 07:52:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4083506#M162089</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-06T07:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4084974#M162134</link>
      <description>Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;, The sterilized data is in the screenshot above under where it says, "My current and desired outcome". Unfortunately, I can't share the PBI file directly. There was no change in what shows up in that data dump between my original post and when I made the updates you suggested to "Running Capacity"</description>
      <pubDate>Tue, 06 Aug 2024 19:03:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4084974#M162134</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-06T19:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4085212#M162143</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Try Below measures&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var a = SUMX(FILTER(ALL('Table'[Stack Rank],'Table'[Capacity]),'Table'[Stack Rank]=1),'Table'[Capacity])
var b = MAXX(FILTER(ALL('Table'[Stack Rank]),'Table'[Stack Rank]&amp;lt;MIN('Table'[Stack Rank])),[Stack Rank])
var c = SUMX(FILTER(ALL('Table'[Stack Rank],'Table'[Total Demand]),'Table'[Stack Rank]&amp;lt;MIN('Table'[Stack Rank])),'Table'[Total Demand])
RETURN
a-c&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;% Measure&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%_Measure = 
DIVIDE(SUM('Table'[Total Demand]),SUMX('Table',[Measure]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Dangar&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 21:33:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4085212#M162143</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-06T21:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4085357#M162148</link>
      <description>&lt;P&gt;Hi Dangar,&lt;/P&gt;&lt;P&gt;Unfortunately your solution doesn't take into account that the Stack Rank (Raw), Capacity and Total Demand fields all come from different (but related) tables and the ALL function only allows fields from the same table. Modifying your formula to include the actual table names as noted above, this is what it looks like:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Running Capacity = var a = SUMX(FILTER(ALL('Projects'[Stack Rank (Raw)],'ResourceTimephasedDataSet'[Capacity]),'Projects'[Stack Rank (Raw)]=1),'ResourceTimephasedDataSet'[Capacity]) var b = MAXX(FILTER(ALL('Projects'[Stack Rank (Raw)]),'Projects'[Stack Rank (Raw)]&lt;/LI-CODE&gt;&lt;P&gt;The error message thrown is:&lt;/P&gt;&lt;P&gt;"All column arguments of the ALL/ALLNOBLANKROW/ALLSELECTED/REMOVEFILTERS function must be from the same table."&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 23:19:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4085357#M162148</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-06T23:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089611#M162316</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;It seems like we're so close! I tried merging the Capacity and Stack Rank fields all into the AssignmentTimephasedDateSet table, but its so huge that I can't even get to the point of being able to do field grouping to get it down to a manageable number of rows before it times out. Do you have a way of modifying your measure to allow for the fields to be in the different tables, instead of 1?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 15:40:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089611#M162316</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-08T15:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089767#M162324</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide some sample data it would be great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Dangar&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider Accept it as the solution to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 17:05:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089767#M162324</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-08T17:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089953#M162330</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can try below measure&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR a =
    CALCULATE (
        SUM ( 'ResourceTimephasedDataSet'[Capacity] ),
        'Projects'[Stack Rank (Raw)] = 1,
        REMOVEFILTERS ()
    )
VAR b =
    MAXX (
        FILTER (
            ALL ( 'Projects'[Stack Rank (Raw)] ),
            'Projects'[Stack Rank (Raw)] &amp;lt; 'Projects'[Stack Rank (Raw)]
        ),
        'Projects'[Stack Rank (Raw)]
    )
VAR c =
    CALCULATE (
        SUM ( 'Yourtablename'[Total Demand] ),
        FILTER (
            ALL ( 'Projects'[Stack Rank (Raw)] ),
            'Projects'[Stack Rank (Raw)] &amp;lt; MIN ( 'Projects'[Stack Rank (Raw)] )
        )
    )
RETURN
    a - c&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%_Measure =
DIVIDE (
    SUM ( 'Yourtablename'[Total Demand] ),
    SUMX ( ALL ( 'Projects'[Stack Rank (Raw)] ), [Measure] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Dangar&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 19:04:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4089953#M162330</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-08T19:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092110#M162393</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;Can you clarify specifically what sample data you need? I provided screenshots of the output in the original post. Do you need that in text format? Data scraped from the underlying related tables? I'll do what I can to help.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 15:19:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092110#M162393</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-09T15:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092447#M162403</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Form your screen short it's not useful to generate output you want.&lt;BR /&gt;it would be better if you proivde&amp;nbsp; data Table wise and Relationship-column from which Tables are connected .&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 18:04:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092447#M162403</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-09T18:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092563#M162406</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;I think I see what you're getting at, and I noticed that I left off a crucial piece of information: the field, which is called "Total Demand" in the visual, is actually a field called "AssignmentWork" on the AssignmentTimephasedDataSet. Sorry for any confusion that caused. I'll see if I can update the original post as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Projects table, which contains the "Stack Rank (Raw)" field has a primary Key, ProjectUID, which is related to the AssignmentTimephasedDataSet table, which has the AssignmentWork field, in a 1:Many relationship on ProjectUID (bi-directional):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The ResourceTimephasedDataSet, which has the Capacity and UtilizationPercentage fields, also has a Foreign Key called ResourceUID, and is related to the intermediary Resources table in a Many:1 relationship on ResourceUID (one-directional):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;From there, Resources is related to AssignmentTimephasedDataSet on its Primary Key, ResourceUID in a 1:Many relationship (bi-directional):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is what the output of the these tables and relationships looks like in Power BI (note: I reset the column names so they match the table field names for clarity):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 19:30:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092563#M162406</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-09T19:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092582#M162407</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Did you try my yesterday's Measure.&lt;BR /&gt;I had make that measure after seeing your semantic model and it might work for you.&lt;/P&gt;
&lt;P&gt;just do one thing in that measure&lt;BR /&gt;in that measure just replace &lt;STRONG&gt;sum('Yourtablename'[totaldemand]) &lt;/STRONG&gt;with &lt;STRONG&gt;sum(assignmentTimephasedDataSet'[AssignmentWork]).&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR a =
    CALCULATE (
        SUM ( 'ResourceTimephasedDataSet'[Capacity] ),
        'Projects'[Stack Rank (Raw)] = 1,
        REMOVEFILTERS ()
    )
VAR b =
    MAXX (
        FILTER (
            ALL ( 'Projects'[Stack Rank (Raw)] ),
            'Projects'[Stack Rank (Raw)] &amp;lt; 'Projects'[Stack Rank (Raw)]
        ),
        'Projects'[Stack Rank (Raw)]
    )
VAR c =
    CALCULATE (
       sum('assignmentTimephasedDataSet'[AssignmentWork]),
        FILTER (
            ALL ( 'Projects'[Stack Rank (Raw)] ),
            'Projects'[Stack Rank (Raw)] &amp;lt; MIN ( 'Projects'[Stack Rank (Raw)] )
        )
    )
RETURN
    a - c&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;Let me Know that part work or not?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Dangar&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider Accept it as the solution to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:04:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092582#M162407</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-09T20:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092592#M162408</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;I tried out what you sent. It looks like its just copying down the first value:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:12:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092592#M162408</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-09T20:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092602#M162409</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;try below measure&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR a =
    CALCULATE (
        SUM ( 'ResourceTimephasedDataSet'[Capacity] ),
        'Projects'[Stack Rank (Raw)] = 1,
        REMOVEFILTERS ()
    )
var b = CALCULATE(
max('Projects'[Stack Rank (Raw)]),
'Projects'[Stack Rank (Raw)]&amp;lt; max('Projects'[Stack Rank (Raw)])
)
VAR c =
    CALCULATE (
       sum('assignmentTimephasedDataSet'[AssignmentWork]),
        'Projects'[Stack Rank (Raw)]&amp;lt;b
    )
RETURN
    a - c

&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;If it not work then&amp;nbsp;&lt;BR /&gt;Could you please provide some sample data along with the tables you mentioned above? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:40:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092602#M162409</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-08-09T20:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092683#M162414</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;That didn't work either, sadly. It was the same result as the previous; repeated values.&lt;/P&gt;&lt;P&gt;I can't send the full Power BI file because of privacy stuff, but I did a data dump of the relevant columns of the tables with as many rows as I could export (Power BI maxes out at 1000 rows) and put them in an Excel file, and made the data model mimic what is in my Power BI file. Here is the link:&amp;nbsp;&lt;A href="https://docs.google.com/spreadsheets/d/12_LiG4hT-e3cq5AlsaUWzxzKUK2zZcDY/edit?usp=sharing&amp;amp;ouid=102253249084355900549&amp;amp;rtpof=true&amp;amp;sd=true" target="_blank" rel="noopener"&gt;https://docs.google.com/spreadsheets/d/12_LiG4hT-e3cq5AlsaUWzxzKUK2zZcDY/edit?usp=sharing&amp;amp;ouid=102253249084355900549&amp;amp;rtpof=true&amp;amp;sd=true&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps, and thank you for all your efforts.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 22:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4092683#M162414</guid>
      <dc:creator>Gabe_V1</dc:creator>
      <dc:date>2024-08-09T22:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running Decrement based on two values from 3 related tables.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4140245#M164517</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="580897" data-lia-user-login="Gabe_V1" class="lia-mention lia-mention-user"&gt;Gabe_V1&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data you provided cannot be tested, and when I create the PBIX file and connect the relationships, I find that there is no match between the ProjectUID in the Project and the ProjectUID in the AssignmentTimephasedDataSet table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If possible, please simplify&amp;nbsp;your data and make sure it's correct.&lt;/P&gt;
&lt;P&gt;It would be helpful to find out the solution. You can refer the following links to share the required info:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 08:39:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Decrement-based-on-two-values-from-3-related-tables/m-p/4140245#M164517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-09T08:39:12Z</dc:date>
    </item>
  </channel>
</rss>

