<?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: Amount of refuel in trip Correct calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2988631#M100440</link>
    <description>&lt;P&gt;Hello Dear friend&amp;nbsp;&amp;nbsp;&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;&lt;BR /&gt;I am very happy for you,&amp;nbsp;I thank you for your decision and the time allocated for this.&lt;BR /&gt;But during that time we achieved the goal ourselves.&amp;nbsp;&lt;BR /&gt;We got a unique tip number and calculated the amount at the end of the flight.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Refueled in flight = -- Calculated column
 VAR _1 = CALCULATE( 
     SUM ('Export'[Amount of fuel]), 
     'Export'[Type_of_operation] in {"Gas station","Entrance to the base"}, NOT 'Export'[Refueling point] in {"Base"})
 return
 _1

Amount trip = -- measure
VAR _1 = 
    CALCULATE (
        SUM( 'Export'[Amount_trip]),  ALLEXCEPT('Export','Export'[ID_Trip]))
return
IF(  [Start/End] = "End",  _1 )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I think your solution will be valuable for other Power bi analysts&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2022 09:50:37 GMT</pubDate>
    <dc:creator>DimaMD</dc:creator>
    <dc:date>2022-12-26T09:50:37Z</dc:date>
    <item>
      <title>Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973381#M99471</link>
      <description>&lt;P&gt;Hello community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help in correct count of amount of fuel in my table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have following data:&lt;/P&gt;
&lt;P&gt;1) Vehicle&lt;/P&gt;
&lt;P&gt;2) Dates&lt;/P&gt;
&lt;P&gt;3) Type of operation&lt;/P&gt;
&lt;P&gt;4) Refueling point&lt;/P&gt;
&lt;P&gt;5) Start/end&lt;/P&gt;
&lt;P&gt;6)&amp;nbsp;Amount of refuel&lt;/P&gt;
&lt;P&gt;7) Formula&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are interested in counting the amount of fuel which was refueled in points, which are not blank and not equal to "Base"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example we have a trip which starts on 23.10.2022 and end's on 27.10.2022, so we have 1 row which is not blank and not equal to "Base".&amp;nbsp; The result should be 49,16&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of this count must be saved in cell of collum "Amount refuel", which row is marked as "End" in "Start/end" collum (in current table you can see "0" in that cell). So in the row of 27.10.2022 where type of operation is "Entrance to the base" and the "start\end" collum is marked as "end" we shold have amount of 49,16 in "amount refuel" cell, instead of "0"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Example file&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/17l19vyEqX5vLYZtJbFp6MQByZfLRYZUN/view?usp=share_link" target="_self"&gt;Pbix File&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 12:38:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973381#M99471</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2022-12-16T12:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973459#M99479</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312820" data-lia-user-login="DimaMD" class="lia-mention lia-mention-user"&gt;DimaMD&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you share sample output in table format?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:26:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973459#M99479</guid>
      <dc:creator>Mahesh0016</dc:creator>
      <dc:date>2022-12-16T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973502#M99482</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="478098" data-lia-user-login="Mahesh0016" class="lia-mention lia-mention-user"&gt;Mahesh0016&lt;/a&gt;&amp;nbsp;Yes,&amp;nbsp;Will view the attached excel file.&lt;BR /&gt;I highlighted trips in which refueling took place between the start of the trip and the end of the trip.&lt;BR /&gt;As a final result, we should see the total amount of fuel filled at the end of the trip&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:53:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2973502#M99482</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2022-12-16T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2976056#M99642</link>
      <description>&lt;P&gt;HI&amp;nbsp;&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;,&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; We need your help in solving the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 14:11:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2976056#M99642</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2022-12-19T14:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2987571#M100348</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312820" data-lia-user-login="DimaMD" class="lia-mention lia-mention-user"&gt;DimaMD&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hello friend!&lt;/P&gt;
&lt;P&gt;Hope this is what you're looking for&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 13:46:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2987571#M100348</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-24T13:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2988631#M100440</link>
      <description>&lt;P&gt;Hello Dear friend&amp;nbsp;&amp;nbsp;&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;&lt;BR /&gt;I am very happy for you,&amp;nbsp;I thank you for your decision and the time allocated for this.&lt;BR /&gt;But during that time we achieved the goal ourselves.&amp;nbsp;&lt;BR /&gt;We got a unique tip number and calculated the amount at the end of the flight.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Refueled in flight = -- Calculated column
 VAR _1 = CALCULATE( 
     SUM ('Export'[Amount of fuel]), 
     'Export'[Type_of_operation] in {"Gas station","Entrance to the base"}, NOT 'Export'[Refueling point] in {"Base"})
 return
 _1

Amount trip = -- measure
VAR _1 = 
    CALCULATE (
        SUM( 'Export'[Amount_trip]),  ALLEXCEPT('Export','Export'[ID_Trip]))
return
IF(  [Start/End] = "End",  _1 )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;I think your solution will be valuable for other Power bi analysts&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 09:50:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2988631#M100440</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2022-12-26T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of refuel in trip Correct calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2988757#M100461</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312820" data-lia-user-login="DimaMD" class="lia-mention lia-mention-user"&gt;DimaMD&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Which decision?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:44:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-refuel-in-trip-Correct-calculation/m-p/2988757#M100461</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-26T11:44:47Z</dc:date>
    </item>
  </channel>
</rss>

