<?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: Get the First value of my table and Get it in a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2378614#M61383</link>
    <description>&lt;P&gt;You could use TOPN to get the values for the earliest date, the basic idea would be&lt;/P&gt;&lt;PRE&gt;Val Min = SELECTCOLUMNS( TOPN(1, 'Table', 'Table'[Sort Column], ASC), "@val", 'Table'[Value Column] )&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Mar 2022 12:30:58 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-03-07T12:30:58Z</dc:date>
    <item>
      <title>Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377340#M61317</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please, your support. I am trying to obtain the value of the first day in this table. You always have 15 days and you want to obtain the value of the first day in one measure. I do it in the following way:&amp;nbsp;&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;&lt;SPAN&gt;Thank you very much in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 22:39:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377340#M61317</guid>
      <dc:creator>Tux-CM</dc:creator>
      <dc:date>2022-03-06T22:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377764#M61337</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;The basic pattern for getting first values from visible dates is like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_date&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;(&lt;/SPAN&gt;&lt;SPAN&gt;Aggregation[Opened At]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Aggregation[Opened At]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;//Here we get the earliest date available from the visible dates&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Aggregation[Duration(Secs)]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Aggregation'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Aggregation[Opened At]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;_date&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/P&gt;
&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Mar 2022 05:52:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377764#M61337</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-03-07T05:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377863#M61340</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;,, the formula you provide me does not calculate correctly:&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The formula that it provides me only works if it does not have several columns, that is why I use the following formula but it does not perform the correct calculation:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;ValMin =CALCULATE(SUMX(ALLSELECTED(Quiebre_8S[Fecha]),[Prom Valorizado L2W]),Quiebre_8S[Ranking]=1)&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 06:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377863#M61340</guid>
      <dc:creator>Tux-CM</dc:creator>
      <dc:date>2022-03-07T06:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377888#M61343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="364337" data-lia-user-login="Tux-CM" class="lia-mention lia-mention-user"&gt;Tux-CM&lt;/a&gt;&amp;nbsp; That seems quite odd,&lt;BR /&gt;&lt;BR /&gt;What kind of aggregation do you use for [Stock_valorizado] in your example? I suspect that there might be more values for 19.2.2022 and for that reason the result returned is too large.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The easy way to troubleshoot these kind of measures is to comment out parts of the measure (e.g. here I check if the date returned in the variable is the correct one):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 06:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2377888#M61343</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-03-07T06:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2378614#M61383</link>
      <description>&lt;P&gt;You could use TOPN to get the values for the earliest date, the basic idea would be&lt;/P&gt;&lt;PRE&gt;Val Min = SELECTCOLUMNS( TOPN(1, 'Table', 'Table'[Sort Column], ASC), "@val", 'Table'[Value Column] )&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 12:30:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2378614#M61383</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-03-07T12:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get the First value of my table and Get it in a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2383154#M61656</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="364337" data-lia-user-login="Tux-CM" class="lia-mention lia-mention-user"&gt;Tux-CM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ALLSELECTED() just remove the column you specailed. For the context of each row in your matrix table when you add [Categoria] to this viausl, another filter affect this filter context of this row, so, please also remove the filter comes from [Categoria], like REMOVERFILTER('&lt;SPAN&gt;Quiebre_8S'[Categoria]) in var _date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or try this code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;measure =
VAR _date =
    CALCULATE ( MIN ( 'Quiebre_8S'[Fecha] ), ALL () )
RETURN
    CALCULATE (
        [Prom Valorizado L2W],
        FILTER ( ALLSELECTED ( 'Quiebre_8S'[Fecha] ), [Fecha] = _date )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&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>Wed, 09 Mar 2022 09:21:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-First-value-of-my-table-and-Get-it-in-a-measure/m-p/2383154#M61656</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-03-09T09:21:49Z</dc:date>
    </item>
  </channel>
</rss>

