<?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 Graph doesn't place average per year correctly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/138551#M256</link>
    <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering what is wrong with my DAX formula or with my graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a graph with on the axis, date and &amp;nbsp;on values I placed average per year.&lt;/P&gt;&lt;P&gt;The formula I am using to determine my average per year already got a date in it, it uses the date table.&lt;/P&gt;&lt;P&gt;I would like to get some help with figuring out where the problem is :)&lt;/P&gt;&lt;P&gt;average&amp;nbsp;amount of unique visitors &amp;nbsp;2016 = CALCULATE(&lt;BR /&gt;AVERAGEX('&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;','&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;'[&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(Datedimension[Datekey]),&lt;BR /&gt;and (&lt;BR /&gt;'Datedimension'[Datekey]&amp;gt;= DATE(2016, 1 , 1),&lt;BR /&gt;'Datedimension'[Datekey]&amp;lt;= DATE(2016,12,31)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Thanks in advance :)&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 08:11:38 GMT</pubDate>
    <dc:creator>0xygen27</dc:creator>
    <dc:date>2017-03-08T08:11:38Z</dc:date>
    <item>
      <title>Graph doesn't place average per year correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/138551#M256</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering what is wrong with my DAX formula or with my graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a graph with on the axis, date and &amp;nbsp;on values I placed average per year.&lt;/P&gt;&lt;P&gt;The formula I am using to determine my average per year already got a date in it, it uses the date table.&lt;/P&gt;&lt;P&gt;I would like to get some help with figuring out where the problem is :)&lt;/P&gt;&lt;P&gt;average&amp;nbsp;amount of unique visitors &amp;nbsp;2016 = CALCULATE(&lt;BR /&gt;AVERAGEX('&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;','&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;'[&lt;SPAN&gt;amount of unique visitors&lt;/SPAN&gt;]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(Datedimension[Datekey]),&lt;BR /&gt;and (&lt;BR /&gt;'Datedimension'[Datekey]&amp;gt;= DATE(2016, 1 , 1),&lt;BR /&gt;'Datedimension'[Datekey]&amp;lt;= DATE(2016,12,31)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Thanks in advance :)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 08:11:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/138551#M256</guid>
      <dc:creator>0xygen27</dc:creator>
      <dc:date>2017-03-08T08:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Graph doesn't place average per year correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3400548#M128385</link>
      <description>&lt;P&gt;Can you please tell me if the problem is still relevant? If you managed to solve it in some way, please write here how you solved this problem. Then it will be possible to mark this problem as solved.&lt;/P&gt;
&lt;P&gt;If not, it may make sense to ask the question again, thus confirming the relevance of this problem.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Aug 2023 21:19:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3400548#M128385</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2023-08-26T21:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Graph doesn't place average per year correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3401865#M128475</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="22131" data-lia-user-login="0xygen27" class="lia-mention lia-mention-user"&gt;0xygen27&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have two tables? One contains vistors and a date table? The date table is marked as a &lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables" target="_blank" rel="noopener"&gt;date table&lt;/A&gt;? The date table has a one to many relationship with the Vistor table on the date column on both tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try these.&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;Total Unique Vistors = DISTINCTCOUNT(Vistors[UserID])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or using the above 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;Total Unique Vistors YTD = TOTALYTD([Total Unique Vistors], DateTable[Date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a matrix with the Year from the date table in wither column or row section and then add the either measure to the Value section to get desired result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If this post helps, then please Accept it as the solution&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need to unique vistors,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 08:59:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3401865#M128475</guid>
      <dc:creator>JoeBarry</dc:creator>
      <dc:date>2023-08-28T08:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Graph doesn't place average per year correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3402480#M128503</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description and the DAX formula provided, I see a couple of potential issues:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Naming Convention:&lt;/STRONG&gt; The way you've named your tables and columns is a bit confusing. For instance, having a table named &lt;CODE&gt;'amount of unique visitors'&lt;/CODE&gt; and then a column within that table named &lt;CODE&gt;'[amount of unique visitors]'&lt;/CODE&gt; can be misleading and cause potential mistakes.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;AVERAGEX&lt;/STRONG&gt;: This function averages the results of an expression calculated for each row in a table. It's important to ensure that the expression used inside &lt;CODE&gt;AVERAGEX&lt;/CODE&gt; is accurately capturing what you want to average. In your case, you're just referencing the column, which might not be yielding what you intend.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;ALL function&lt;/STRONG&gt;: When using the &lt;CODE&gt;ALL&lt;/CODE&gt; function in conjunction with &lt;CODE&gt;FILTER&lt;/CODE&gt;, you're effectively removing any filters on the &lt;CODE&gt;Datedimension[Datekey]&lt;/CODE&gt; and then reapplying them based on the conditions you specified in the &lt;CODE&gt;FILTER&lt;/CODE&gt; function. It's not inherently wrong, but it's worth noting in case there are any other filters being applied elsewhere in your model that you would want to consider.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Let's try to address the problems and refine the formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AverageUniqueVisitors2016 = 
CALCULATE(
    AVERAGE('amount of unique visitors'[amount of unique visitors]),
    FILTER(
        ALL(Datedimension[Datekey]),
        Datedimension[Datekey] &amp;gt;= DATE(2016, 1 , 1) &amp;amp;&amp;amp; 
        Datedimension[Datekey] &amp;lt;= DATE(2016,12,31)
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 14:53:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Graph-doesn-t-place-average-per-year-correctly/m-p/3402480#M128503</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2023-08-28T14:53:41Z</dc:date>
    </item>
  </channel>
</rss>

