<?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: Calculating the average factor for months with data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982076#M154405</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="547299" data-lia-user-login="Fistachpl" class="lia-mention lia-mention-user"&gt;Fistachpl&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did you apply sort by column to the Month field? If so, please add the sort&amp;nbsp;reference field to the ALL function as well, y&lt;/SPAN&gt;&lt;SPAN&gt;ou can try below measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AvgWsp over the year = COUNTX(ALL('TMiesiące'[Month],'TMiesiące'[Month Number]),[AvgWsp])

// Change the 'TMiesiące'[Month Number] to your acthal name, which should be use to sort by column setting.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the rationale for doing this, pls see my answer in another thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-function-on-a-specific-column-not-working-like-I-think-it/m-p/3981518#M154388" target="_blank"&gt;https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-function-on-a-specific-column-not-working-like-I-think-it/m-p/3981518#M154388&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jun 2024 18:18:34 GMT</pubDate>
    <dc:creator>xifeng_L</dc:creator>
    <dc:date>2024-06-09T18:18:34Z</dc:date>
    <item>
      <title>Calculating the average factor for months with data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982010#M154398</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have a visual a table with:&lt;BR /&gt;Month - name of the month&lt;BR /&gt;Avg Sale Per Year - average sale in Januaries, Februaries etc. from selected timeframe&lt;BR /&gt;Sold CY - sold in current year in each month&lt;BR /&gt;AvgWsp - factor comparing the amount of Sold in Current year divided by Average Sale per Year&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now I need to calculate the average factor this means:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; _sumOfFactors = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLNOBLANKROW&lt;/SPAN&gt;&lt;SPAN&gt;('TMiesiące'[Nr miesiąca]);[AvgWsp]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;REMOVEFILTERS&lt;/SPAN&gt;&lt;SPAN&gt;('TMiesiące'[Month])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&lt;/SPAN&gt;Which is correctly calculated.&lt;BR /&gt;&lt;BR /&gt;How can I calculate the amount of calculated factors - in this case the answer is 5.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 09 Jun 2024 15:49:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982010#M154398</guid>
      <dc:creator>Fistachpl</dc:creator>
      <dc:date>2024-06-09T15:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the average factor for months with data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982034#M154400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="#community--1-" target="_blank" rel="noopener"&gt;@Fistachpl&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if I understood your question correctly, you can try this measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Amount of factors = SUMX(ALL('TMiesiące'[Month]),[AvgWsp over the year])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 16:32:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982034#M154400</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-06-09T16:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the average factor for months with data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982057#M154403</link>
      <description>&lt;P&gt;This calculates the sum of those but to get average factor I need to calculate the sum (which I already have) and divide it by the number of factors to get the average factor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to calculate by:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; _amountOfFactors = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNTX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;('TMiesiące'[Month]);[AvgWsp]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;('TMiesiące'[Month]);[AvgWsp]&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;and got:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;But in the table I want to have 5.&amp;nbsp;&lt;BR /&gt;I know I can just use:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_amountOfFactors&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;now&lt;/SPAN&gt;&lt;SPAN&gt;())-&lt;/SPAN&gt;&lt;SPAN&gt;1 (with safety for January so I do not get 0) but I want to learn &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&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>Sun, 09 Jun 2024 18:01:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982057#M154403</guid>
      <dc:creator>Fistachpl</dc:creator>
      <dc:date>2024-06-09T18:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the average factor for months with data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982076#M154405</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="547299" data-lia-user-login="Fistachpl" class="lia-mention lia-mention-user"&gt;Fistachpl&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did you apply sort by column to the Month field? If so, please add the sort&amp;nbsp;reference field to the ALL function as well, y&lt;/SPAN&gt;&lt;SPAN&gt;ou can try below measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AvgWsp over the year = COUNTX(ALL('TMiesiące'[Month],'TMiesiące'[Month Number]),[AvgWsp])

// Change the 'TMiesiące'[Month Number] to your acthal name, which should be use to sort by column setting.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the rationale for doing this, pls see my answer in another thread.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-function-on-a-specific-column-not-working-like-I-think-it/m-p/3981518#M154388" target="_blank"&gt;https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-function-on-a-specific-column-not-working-like-I-think-it/m-p/3981518#M154388&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 18:18:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982076#M154405</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-06-09T18:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the average factor for months with data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982077#M154406</link>
      <description>&lt;P&gt;Tomorrow I will read about this sorting but I did not have top change the sorting in any way. It worked perfectly.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank You!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 18:29:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-average-factor-for-months-with-data/m-p/3982077#M154406</guid>
      <dc:creator>Fistachpl</dc:creator>
      <dc:date>2024-06-09T18:29:28Z</dc:date>
    </item>
  </channel>
</rss>

