<?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: Trying to get a value from the first week in a graph from a pivot table to use as baseline in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2943991#M97334</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="480400" data-lia-user-login="Belarminio" class="lia-mention lia-mention-user"&gt;Belarminio&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I suggest you to try this code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _MINDATE =
    CALCULATE (
        MIN ( 'All Weekly Data'[Week Ends] ),
        FILTER ( ALL ( 'All Weekly Data' ), 'All Weekly Data'[Source] = "Current" )
    )
RETURN
    CALCULATE (
        SUM ( 'All Weekly Data'[Bodies for Week] ),
        ALLSELECTED ( 'All Weekly Data' ),
        'All Weekly Data'[Source] = "Current",
        'All Weekly Data'[Week Ends] = _MINDATE
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Rico Zhou&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>Fri, 02 Dec 2022 08:32:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-02T08:32:43Z</dc:date>
    <item>
      <title>Trying to get a value from the first week in a graph from a pivot table to use as baseline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942367#M97230</link>
      <description>&lt;P&gt;i'm looking to graph this pic below the baseline line has to be a value from the first week. This formula does the trick&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;CALCULATE(SUM('All Weekly Data'[Bodies for Week]),ALLSELECTED('All Weekly Data'),'All Weekly Data'[Source]="Current",'All Weekly Data'[Week Ends] = DATE(2022,3,12) )&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;however i need it to be dinamic and since i'm hard coding the Date(2022,3,12) that not posible.&lt;/P&gt;&lt;P&gt;i have tried a number of combinations of Filter funtion and i can't get anything to work. any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;+&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>Thu, 01 Dec 2022 16:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942367#M97230</guid>
      <dc:creator>Belarminio</dc:creator>
      <dc:date>2022-12-01T16:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a value from the first week in a graph from a pivot table to use as baseline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942435#M97233</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="480400" data-lia-user-login="Belarminio" class="lia-mention lia-mention-user"&gt;Belarminio&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Date = MIN('All Weekly Data'[Week Ends])
  VAR __Result =  
CALCULATE(SUM('All Weekly Data'[Bodies for Week]),ALLSELECTED('All Weekly Data'),'All Weekly Data'[Source]="Current",'All Weekly Data'[Week Ends] = __Date )
RETURN
  __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 16:33:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942435#M97233</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-12-01T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a value from the first week in a graph from a pivot table to use as baseline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942669#M97247</link>
      <description>&lt;P&gt;Thanks for your reply Greg i did not mentioned that i tryed that before and i get an error when i do. i think that your example is from Power BI, how ever i'm using the DAX in Powere Pivot.&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Var 1:=&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;MIN&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'[Week Ends]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'[Week Ends]))&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Var 2:=&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'[Bodies for Week]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'),'All Weekly Data'[Source]=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Current"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,'All Weekly Data'[Week Ends] = [Var 1] )&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;if i use this formula&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;Var 2:=&lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'[Bodies for Week]),&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data'),'All Weekly Data'[Source]=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Current"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;FILTER&lt;/SPAN&gt;&lt;SPAN class=""&gt;('All Weekly Data','All Weekly Data'[Week Ends] = [Var 1] ))&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Then i get this result.. as you can see the the date is fine in the Var 1 column, but the Var 2 is still not giving me the the number in the 1st week... for some reason not clear to me the ALLSELECTED funtion is bein cancelled by the FILTER funtion somehow.&lt;/SPAN&gt;&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>Thu, 01 Dec 2022 18:30:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2942669#M97247</guid>
      <dc:creator>Belarminio</dc:creator>
      <dc:date>2022-12-01T18:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a value from the first week in a graph from a pivot table to use as baseline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2943991#M97334</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="480400" data-lia-user-login="Belarminio" class="lia-mention lia-mention-user"&gt;Belarminio&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I suggest you to try this code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _MINDATE =
    CALCULATE (
        MIN ( 'All Weekly Data'[Week Ends] ),
        FILTER ( ALL ( 'All Weekly Data' ), 'All Weekly Data'[Source] = "Current" )
    )
RETURN
    CALCULATE (
        SUM ( 'All Weekly Data'[Bodies for Week] ),
        ALLSELECTED ( 'All Weekly Data' ),
        'All Weekly Data'[Source] = "Current",
        'All Weekly Data'[Week Ends] = _MINDATE
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Rico Zhou&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>Fri, 02 Dec 2022 08:32:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2943991#M97334</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-02T08:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get a value from the first week in a graph from a pivot table to use as baseline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2945279#M97398</link>
      <description>&lt;P&gt;Thanks every one for your help the answer you provided makes absolute sense but still it give me an error.&amp;nbsp; I tried several things and again not sure why these solutions don’t work because the look logical.&amp;nbsp; If that works for you the error may have something to do with the version of power BI I use I am really not sure but I tried that variation and still got an error. The error happens because of this section &lt;STRONG&gt;'All (Weekly Data'[Week Ends] = _MINDATE&lt;/STRONG&gt;&amp;nbsp; it just wont take it.&lt;/P&gt;&lt;P&gt;Happily I have tried enough spaghetti in the wall that something finally stuck. This solution actually worked.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;First Week:=&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data'[Week Ends]),&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data')) = &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data'[Week Ends]),&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data'[Week Ends]),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cost - Base Line:=&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data'[Cost for Week]),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;('All Weekly Data'),'All Weekly Data'[Week Ends]=[First Week]), 'All Weekly Data'[Source]= &lt;/SPAN&gt;&lt;SPAN&gt;"Current"&lt;/SPAN&gt;&lt;SPAN&gt;)&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>Fri, 02 Dec 2022 18:32:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-get-a-value-from-the-first-week-in-a-graph-from-a/m-p/2945279#M97398</guid>
      <dc:creator>Belarminio</dc:creator>
      <dc:date>2022-12-02T18:32:25Z</dc:date>
    </item>
  </channel>
</rss>

