<?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: Determine start and end coordinates for each distinct trip. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512409#M29399</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , add a measure like this and all other un summarized column&lt;/P&gt;
&lt;P&gt;calculate(min(Table[timestamp]), filter(Table, Table[timestamp] = calculate(min(Table[timestamp]), allexcept(Table, Table[trip_id]))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create measure for all other columns then trip_id&lt;/P&gt;</description>
    <pubDate>Tue, 24 Nov 2020 02:31:03 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-11-24T02:31:03Z</dc:date>
    <item>
      <title>Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512391#M29398</link>
      <description>&lt;P&gt;I need to determine the Start and End (i.e. first/earliest) coordinates based on a timestamped trip data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;trip_id&lt;/TD&gt;&lt;TD&gt;timestamp&lt;/TD&gt;&lt;TD&gt;latitude&lt;/TD&gt;&lt;TD&gt;longitude&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;.... 06:00 AM&lt;/TD&gt;&lt;TD&gt;....1000&lt;/TD&gt;&lt;TD&gt;....500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;.... 06:01 AM&lt;/TD&gt;&lt;TD&gt;....1001&lt;/TD&gt;&lt;TD&gt;....499&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;.... 06:02 AM&lt;/TD&gt;&lt;TD&gt;....1001&lt;/TD&gt;&lt;TD&gt;....498&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.... 07:30 AM&lt;/TD&gt;&lt;TD&gt;....1001&lt;/TD&gt;&lt;TD&gt;....399&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.... 07:31 AM&lt;/TD&gt;&lt;TD&gt;....1002&lt;/TD&gt;&lt;TD&gt;....399&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.... 07:32 AM&lt;/TD&gt;&lt;TD&gt;....1002&lt;/TD&gt;&lt;TD&gt;....398&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The starting location is therefore:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;trip_id&lt;/TD&gt;&lt;TD&gt;timestamp&lt;/TD&gt;&lt;TD&gt;latitude&lt;/TD&gt;&lt;TD&gt;longitude&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;.... 06:00 AM&lt;/TD&gt;&lt;TD&gt;....1000&lt;/TD&gt;&lt;TD&gt;....500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;.... 07:30 AM&lt;/TD&gt;&lt;TD&gt;....1001&lt;/TD&gt;&lt;TD&gt;....399&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a similar result for the end location. I can then plot the latitude &amp;amp; longitudes on a Map widget.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 02:10:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512391#M29398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-24T02:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512409#M29399</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , add a measure like this and all other un summarized column&lt;/P&gt;
&lt;P&gt;calculate(min(Table[timestamp]), filter(Table, Table[timestamp] = calculate(min(Table[timestamp]), allexcept(Table, Table[trip_id]))))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create measure for all other columns then trip_id&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 02:31:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512409#M29399</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-24T02:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512599#M29400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;A single value for column 'timestamp' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single results.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 04:35:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512599#M29400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-24T04:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512709#M29404</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , I given the name what there in the sample. Please select the correct column name in your power bi file. Or share a sample pbix &lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 06:28:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1512709#M29404</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-24T06:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1514962#M29475</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did substitute my own parameters into the measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you able to clarify your original solution more? The instruction is somewhat unclear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 02:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1514962#M29475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T02:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determine start and end coordinates for each distinct trip.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1517475#M29558</link>
      <description>&lt;P&gt;For anyone else visiting this thread; My solution ended up looking like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I create 2 x measures,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;One for the Earliest date of a trip_id (i.e. start of trip)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Earliest date =&lt;BR /&gt;CALCULATE(MIN('Table'[date]),ALLEXCEPT('Table','Table'[trip_id]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another for Latest date of a trip_id (i.e. end of trip):&amp;nbsp;&lt;/P&gt;&lt;P&gt;Latest date =&lt;BR /&gt;CALCULATE(MAX('Table'[date]),ALLEXCEPT('Table','Table'[trip_id]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, I believe I inserted a custom DAX column. This checks whether [date] is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The start time of a trip&lt;/LI&gt;&lt;LI&gt;The end time of a trip&lt;/LI&gt;&lt;LI&gt;or a somewhere inbetween (a waypoint)&lt;/LI&gt;&lt;LI&gt;The DAX contains a nested IF function, and assigns values based on [date]'s value:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;date_check = IF('Table'[date] = [Latest date], "End Trip", IF('Table'[date] = [Earliest date], "Start Trip", "Waypoint"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These steps could probably be contained in one DAX expression - but I would rather keep it separated so I can use the measures for other things.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 00:54:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Determine-start-and-end-coordinates-for-each-distinct-trip/m-p/1517475#M29558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-26T00:54:38Z</dc:date>
    </item>
  </channel>
</rss>

