<?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: Value for a column within a table, filtering another column's value on the same table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2814357#M89181</link>
    <description>&lt;P&gt;This results in an error. "A table of multiple values was supplied where a single value was expected".&amp;nbsp;&lt;BR /&gt;For some Jobs, the assigned worker is reported more than once with different values. So, when looking up the previous worker, we get more than one result.&amp;nbsp;&lt;BR /&gt;... need some way to summarize values where job and assigned worker or previous worker match&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 15:06:13 GMT</pubDate>
    <dc:creator>nickc_innova</dc:creator>
    <dc:date>2022-10-03T15:06:13Z</dc:date>
    <item>
      <title>Value for a column within a table, filtering another column's value on the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809430#M88825</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I've been at it for a few hours and searched around the forums - closest I have come to a similar problem/solution involves time intelligence and trying to find values via PREVIOUSYEAR().&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a single table with names, values and column for previous name. I am trying to calculate the corresponding previous value.&amp;nbsp;&lt;BR /&gt;The table looks something like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;Note the far right column is what I am trying to return.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My current code looks like this:&lt;/P&gt;&lt;SPAN&gt;Previous Worker Value = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SP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N&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLNOBLANKROW&lt;/SPAN&gt;&lt;SPAN&gt; ( 'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Assigned Worker]&lt;/SPAN&gt;&lt;SPAN&gt; ), 'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Assigned Worker]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;__prev_worker&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;__prev_val&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;However, this is only returning values for me that are equal to the current value, not the previous worker's value for the corresponding job id. Like this:&lt;BR /&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Sep 2022 22:49:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809430#M88825</guid>
      <dc:creator>nickc_innova</dc:creator>
      <dc:date>2022-09-30T22:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Value for a column within a table, filtering another column's value on the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809755#M88904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="430604" data-lia-user-login="nickc_innova" class="lia-mention lia-mention-user"&gt;nickc_innova&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Previous Worker Value = 
CALCULATE ( 
    SUM ( 'Table'[Value] ),
    TREATAS ( { 'Table'[Previous Worker] }, 'Table'[Assigned Worker] ),
    ALLEXCEPT ( 'Table', 'Table'[Job Id] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 04:03:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809755#M88904</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-01T04:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Value for a column within a table, filtering another column's value on the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809773#M88906</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I assume you want to create a calculated column.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the DAX formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;LI-CODE lang="markup"&gt;Previous Worker Value CC =
LOOKUPVALUE (
    Data[Value],
    Data[Assigned Worker], Data[Previous Worker],
    Data[Job ID], Data[Job ID]
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 01 Oct 2022 04:06:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2809773#M88906</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-10-01T04:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Value for a column within a table, filtering another column's value on the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2814357#M89181</link>
      <description>&lt;P&gt;This results in an error. "A table of multiple values was supplied where a single value was expected".&amp;nbsp;&lt;BR /&gt;For some Jobs, the assigned worker is reported more than once with different values. So, when looking up the previous worker, we get more than one result.&amp;nbsp;&lt;BR /&gt;... need some way to summarize values where job and assigned worker or previous worker match&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 15:06:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2814357#M89181</guid>
      <dc:creator>nickc_innova</dc:creator>
      <dc:date>2022-10-03T15:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Value for a column within a table, filtering another column's value on the same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2814377#M89183</link>
      <description>&lt;DIV class=""&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;,&amp;nbsp;thank you so much! Not only did you provide a perfect solution but you also introduced me to something new. I did not know about the TREATAS function. Very interesting.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Oct 2022 15:13:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Value-for-a-column-within-a-table-filtering-another-column-s/m-p/2814377#M89183</guid>
      <dc:creator>nickc_innova</dc:creator>
      <dc:date>2022-10-03T15:13:19Z</dc:date>
    </item>
  </channel>
</rss>

