<?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: Cannot find table while creating a measure using a Table defined withing measure context in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656850#M178296</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241500" data-lia-user-login="marcoie" class="lia-mention lia-mention-user"&gt;marcoie&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is probably due to use of EARLIER function with the same variable.&amp;nbsp;This typically causes a &lt;STRONG data-start="232" data-end="252"&gt;context conflict&lt;/STRONG&gt; because EARLIER expects a row context that isn't being properly established when you're referencing the same table variable inside the same scope.&lt;/P&gt;
&lt;P&gt;Here is alternate code you can use :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NewDate =&lt;BR /&gt;VAR StartDate = [_plan_test_end_date]&lt;BR /&gt;VAR DaysToAdd = [_more_days_value]&lt;/P&gt;
&lt;P&gt;VAR FilteredWorkingDaysTable =&lt;BR /&gt;FILTER(&lt;BR /&gt;dates_reference,&lt;BR /&gt;dates_reference[Date] &amp;gt;= StartDate &amp;amp;&amp;amp; dates_reference[IsWorkingDay] = TRUE&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR WorkingDaysTable =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;"DayOffset",&lt;BR /&gt;RANKX(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;dates_reference[Date],&lt;BR /&gt;,&lt;BR /&gt;ASC,&lt;BR /&gt;Dense&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR TargetDate =&lt;BR /&gt;MINX(&lt;BR /&gt;FILTER(&lt;BR /&gt;WorkingDaysTable,&lt;BR /&gt;[DayOffset] &amp;gt;= DaysToAdd&lt;BR /&gt;),&lt;BR /&gt;dates_reference[Date]&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;TargetDate&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;
&lt;P&gt;&lt;STRONG&gt;Did I answer your query ? Mark this as solution if this helps, Kudos are appreciated.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;</description>
    <pubDate>Thu, 17 Apr 2025 06:57:18 GMT</pubDate>
    <dc:creator>divyed</dc:creator>
    <dc:date>2025-04-17T06:57:18Z</dc:date>
    <item>
      <title>Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656458#M178279</link>
      <description>&lt;P&gt;In bellow image, dates_reference is my global dates table. This code snipped allos to add a number of working (non weekend, non holiday) days to any given date (here initial dates is&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&lt;FONT color="#0000FF"&gt;[_plan_test_end_date]&lt;/FONT&gt; and days to add is the output of a variable segmentation tied to a manual table&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;_more_days&lt;/SPAN&gt;&lt;SPAN&gt;[_more_days_value]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;).&lt;BR /&gt;&lt;BR /&gt;Steps are:&lt;BR /&gt;1. FIlter general dates table (which is big) for the time starting from the date u wanna work with, excluding non working days.&lt;BR /&gt;2. Calculate how many days (rows) are beween a row and all previous rows as an offset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. See for which date, the offset match teh working days needed.&lt;BR /&gt;&lt;BR /&gt;Crude, but works in tehory. Yet, I define all the "filtered" date tables within the measure, FilteredWorkingDaysTable seems to be created properly (no error), but is not visible in the context of second WorkingDaysTable, seems is not "visible" for using its atributes as filter condition.&lt;BR /&gt;&lt;BR /&gt;Copilot did not helped.&lt;BR /&gt;&lt;BR /&gt;Any clue?&lt;/SPAN&gt;&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;</description>
      <pubDate>Wed, 16 Apr 2025 22:15:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656458#M178279</guid>
      <dc:creator>marcoie</dc:creator>
      <dc:date>2025-04-16T22:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656573#M178283</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how the semantic model looks like, but please try something like below and check if it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above measure,&lt;/P&gt;
&lt;P&gt;Line14 -&amp;gt; change &lt;STRONG&gt;filteredworkingDaysTable[Date]&lt;/STRONG&gt; to&amp;nbsp; &lt;STRONG&gt;date_reference[Date]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Line 21 -&amp;gt; change &lt;STRONG&gt;workingDaysTable[Dayoffset]&lt;/STRONG&gt; to &lt;STRONG&gt;[Dayoffset]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Line 23 -&amp;gt; change &lt;STRONG&gt;workingDaysTable[Date]&lt;/STRONG&gt; to&amp;nbsp;&lt;STRONG&gt;date_reference[Date]&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 02:38:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656573#M178283</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2025-04-17T02:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656835#M178294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241500" data-lia-user-login="marcoie" class="lia-mention lia-mention-user"&gt;marcoie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;BR /&gt;And also Thanks to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp; for quick and helpful response.&lt;/P&gt;
&lt;P&gt;try this dax measure:&lt;/P&gt;
&lt;P&gt;NewDate =&lt;BR /&gt;VAR StartDate = [_plan_test_end_date]&lt;BR /&gt;VAR DaysToAdd = _more_days[_more_days_value]&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;VAR FilteredWorkingDaysTable =&lt;BR /&gt;FILTER(&lt;BR /&gt;dates_reference,&lt;BR /&gt;dates_reference[Date] &amp;gt;= StartDate &amp;amp;&amp;amp;&lt;BR /&gt;dates_reference[IsWorkingDay] = TRUE&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR WorkingDaysTable =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;"DayOffset",&lt;BR /&gt;RANKX(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;dates_reference[Date],&lt;BR /&gt;,&lt;BR /&gt;ASC&lt;BR /&gt;) - 1 )&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;VAR TargetDate =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MIN(dates_reference[Date]),&lt;BR /&gt;FILTER(&lt;BR /&gt;WorkingDaysTable,&lt;BR /&gt;[DayOffset] = DaysToAdd&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;TargetDate&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.&lt;/P&gt;
&lt;P&gt;Thank you &amp;amp; regards,&lt;BR /&gt;Prasanna Kumar&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 06:47:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656835#M178294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-17T06:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656850#M178296</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241500" data-lia-user-login="marcoie" class="lia-mention lia-mention-user"&gt;marcoie&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is probably due to use of EARLIER function with the same variable.&amp;nbsp;This typically causes a &lt;STRONG data-start="232" data-end="252"&gt;context conflict&lt;/STRONG&gt; because EARLIER expects a row context that isn't being properly established when you're referencing the same table variable inside the same scope.&lt;/P&gt;
&lt;P&gt;Here is alternate code you can use :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NewDate =&lt;BR /&gt;VAR StartDate = [_plan_test_end_date]&lt;BR /&gt;VAR DaysToAdd = [_more_days_value]&lt;/P&gt;
&lt;P&gt;VAR FilteredWorkingDaysTable =&lt;BR /&gt;FILTER(&lt;BR /&gt;dates_reference,&lt;BR /&gt;dates_reference[Date] &amp;gt;= StartDate &amp;amp;&amp;amp; dates_reference[IsWorkingDay] = TRUE&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR WorkingDaysTable =&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;"DayOffset",&lt;BR /&gt;RANKX(&lt;BR /&gt;FilteredWorkingDaysTable,&lt;BR /&gt;dates_reference[Date],&lt;BR /&gt;,&lt;BR /&gt;ASC,&lt;BR /&gt;Dense&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;VAR TargetDate =&lt;BR /&gt;MINX(&lt;BR /&gt;FILTER(&lt;BR /&gt;WorkingDaysTable,&lt;BR /&gt;[DayOffset] &amp;gt;= DaysToAdd&lt;BR /&gt;),&lt;BR /&gt;dates_reference[Date]&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;TargetDate&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;
&lt;P&gt;&lt;STRONG&gt;Did I answer your query ? Mark this as solution if this helps, Kudos are appreciated.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 06:57:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4656850#M178296</guid>
      <dc:creator>divyed</dc:creator>
      <dc:date>2025-04-17T06:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4657703#M178336</link>
      <description>&lt;P&gt;Thanks!!! RankX solved the reference issue&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 14:21:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4657703#M178336</guid>
      <dc:creator>marcoie</dc:creator>
      <dc:date>2025-04-17T14:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot find table while creating a measure using a Table defined withing measure context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4657704#M178337</link>
      <description>&lt;P&gt;Thanks this approach ALSo worked well.&lt;BR /&gt;&lt;BR /&gt;Yet, what I did while you guys were patiently creating answers was to create a side "dates_table" that contains ONLY the working days (process is straight forward: I create the standard calendar table picking up my oldest data element date, and going 1 year into future, then I use a REST service that brings national holidays and define a IsWorkingDay based on weekday and national holiday flag, finally I filter that DateTable into a single column table with only the working dats dates (no time), and from there I create an Index, so I just have to "find" the start date, and then add or subtacrt the working days needed on same index to find new date.&lt;BR /&gt;&lt;BR /&gt;I might need to "tests" which metod is faster or has less mem consumption: As I need to use this work days addition/subtraction only with measurements and not for columns, probably the dynamic filtering should be enough, but for a more permanent approach perhaps a dedicated working days table plus index/rank should be faster.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 14:31:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cannot-find-table-while-creating-a-measure-using-a-Table-defined/m-p/4657704#M178337</guid>
      <dc:creator>marcoie</dc:creator>
      <dc:date>2025-04-17T14:31:59Z</dc:date>
    </item>
  </channel>
</rss>

