<?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: How to SUM a value based on criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836970#M39141</link>
    <description>&lt;P&gt;Hi Jihwan, sorry how do I send the file into here?&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 20:26:04 GMT</pubDate>
    <dc:creator>Calumc12</dc:creator>
    <dc:date>2021-05-11T20:26:04Z</dc:date>
    <item>
      <title>How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1835996#M39085</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use DAX to help me find the average distance ran in a game of football which can be compared to training sessions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of my games are assigned with a "game" tag but I can't get the DAX right&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt;&lt;FONT&gt;SUM&lt;/FONT&gt;&lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt;'Data Dump 2021'[TD]&lt;/FONT&gt;&lt;FONT&gt;)&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt; IF&lt;/FONT&gt;&lt;FONT&gt;= 'Data Dump 2021'[Session type]= Game&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Any help would be great&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 11:34:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1835996#M39085</guid>
      <dc:creator>Calumc12</dc:creator>
      <dc:date>2021-05-11T11:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836006#M39088</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241993" data-lia-user-login="Calumc12" class="lia-mention lia-mention-user"&gt;Calumc12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try the below for SUM measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;new measure =&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;CALCULATE (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;SUM ( 'Data Dump 2021'[TD] ),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'Data Dump 2021'[session type] = "Game"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 11:44:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836006#M39088</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-11T11:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836077#M39093</link>
      <description>&lt;P&gt;Hi Jihwan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats been really helpful thank you, I just need an average now instead of SUM and the SUM is adding all the running up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:24:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836077#M39093</guid>
      <dc:creator>Calumc12</dc:creator>
      <dc:date>2021-05-11T12:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836122#M39095</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241993" data-lia-user-login="Calumc12" class="lia-mention lia-mention-user"&gt;Calumc12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;please try the below for finding the average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;new measure =&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;CALCULATE (&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;AVERAGE ( 'Data Dump 2021'[TD] ),&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'Data Dump 2021'[session type] = "Game"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:38:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836122#M39095</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-11T12:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836238#M39102</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use following DAX measure to get desired output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Avg. Run Time = CALCULATE(AVERAGE('Data Dump 2021'[TD]), FILTER('Data Dump 2021', 'Data Dump 2021'[Sessin Type] = "Game"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hasham&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 13:24:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836238#M39102</guid>
      <dc:creator>HashamNiaz</dc:creator>
      <dc:date>2021-05-11T13:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836691#M39126</link>
      <description>&lt;P&gt;Hi Jihwan,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is brilliant and has done exactly what I am looking for. The issue i am running into now..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I have the distance I run on a game day, I want to compare it to what i ran in training (for example) - I have this data to hand and I have worked out a percentage change between the two variables (game distance / training distance-1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I have now is when i chnage the date to any session which isnt a game I get no data returned and therefore the % chnage is "infinty"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how I can stop the game distance to not be responsive to the date selection?&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 16:41:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836691#M39126</guid>
      <dc:creator>Calumc12</dc:creator>
      <dc:date>2021-05-11T16:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836703#M39129</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241993" data-lia-user-login="Calumc12" class="lia-mention lia-mention-user"&gt;Calumc12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;What I can suggest is that try using CALCULATE function and ALL function.&lt;/P&gt;&lt;P&gt;If it is OK with you, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 16:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836703#M39129</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-11T16:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836970#M39141</link>
      <description>&lt;P&gt;Hi Jihwan, sorry how do I send the file into here?&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 20:26:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1836970#M39141</guid>
      <dc:creator>Calumc12</dc:creator>
      <dc:date>2021-05-11T20:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1837052#M39146</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;You can create 3 measures like below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Avg. Game Run Time = CALCULATE(AVERAGE('Data Dump 2021'[TD]), FILTER('Data Dump 2021', 'Data Dump 2021'[Sessin Type] = "Game"))

Avg. Session Run Time = CALCULATE(AVERAGE('Data Dump 2021'[TD]), FILTER('Data Dump 2021', 'Data Dump 2021'[Sessin Type] &amp;lt;&amp;gt; "Game"))

% Diff Run Time = DIVIDE(Avg. Game Run Time, Avg. Session Run Time) - 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first measure will get you Avg. Game Run time, while second measure will calculate Avg. Run time for all other session type, you can change the &amp;lt;&amp;gt; "Game" to whatever session type you wan to compare.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Third measure is used to calculate % Difference between Game run time vs training run time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hasham&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 22:08:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1837052#M39146</guid>
      <dc:creator>HashamNiaz</dc:creator>
      <dc:date>2021-05-11T22:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1837599#M39164</link>
      <description>&lt;P&gt;HI Hasham,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply, this is great but the problem im running into is that I can get "game run time" unless my session is on that date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usually I would want to compare the game norms to a training session although these are on different days and therefore I can compare the two&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 06:26:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1837599#M39164</guid>
      <dc:creator>Calumc12</dc:creator>
      <dc:date>2021-05-12T06:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to SUM a value based on criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1838682#M39205</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;So basically you want to compare Game Run time with Training Run time irrespective of dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do you want to compare these 2 KPI's monthly, yearly. For each month what's the Avg. Run time for Game vs. Training session.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hasham&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 13:48:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-SUM-a-value-based-on-criteria/m-p/1838682#M39205</guid>
      <dc:creator>HashamNiaz</dc:creator>
      <dc:date>2021-05-12T13:48:28Z</dc:date>
    </item>
  </channel>
</rss>

