<?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: Categorical Rolling Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171826#M18079</link>
    <description>&lt;P&gt;put the category for the filter context in a variable, then in the calculate use an ALL() filter against the names and a category filter against your variable.&amp;nbsp; You probably need another variable to calculate the count distinct of names in your category.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jun 2020 02:22:41 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-06-20T02:22:41Z</dc:date>
    <item>
      <title>Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171796#M18066</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of the form:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name | Category | Date | Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-It should be noted that there is a N:1 relationship between a Name and a Category (The same Name will have the same Category, but multiple Name's can share the same Category)&lt;/P&gt;&lt;P&gt;-There can be duplicate Dates for the same Name.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;6/19/2020&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Alice&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;6/19/2020&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;6/19/2020&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;6/19/2020&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;6/20/2020&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get the rolling 7 day average of Sales for each Name (let's call it NameRollAvg)&lt;/LI&gt;&lt;LI&gt;Now for each Category, get the average of SalesRollAvg for all Names belonging to that category (let's call it CategoryRollAvg). However, I do not want simply the average of sales for each category.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ultimately I would like to use these two numbers to compare a Name to the other Name's in its Category:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not representing the sample data above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 00:31:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171796#M18066</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T00:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171798#M18067</link>
      <description>&lt;LI-CODE lang="markup"&gt;NameRollAvg =
var n = SELECTEDVALUE('Table'[Name])
var d = SELECTEDVALUE('Table'[Date])
return calculate (
avg('Table'[Sales])
,'Table'[Date] &amp;gt;= d-7
,'Table'[Name] = n
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;However, I do not want simply the average of sales for each category.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why not? That would be the most "fair"&amp;nbsp; calculation.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 00:59:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171798#M18067</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T00:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171804#M18069</link>
      <description>&lt;P&gt;Thank you for the response,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compare these two numbers NameRollAvg and CategoryRollAvg. Basically to see how did this Name compare to others in it's Category. Take for example, Bob's Sales for this week is 1 and Alice's Sales for this week is 14 and they are both Category A. If we did "average of sales per category" the CategoryRollAvg would be (1 + 14) / 7 = &lt;STRONG&gt;2.14.&lt;/STRONG&gt;.. However, what I would like to see is the average of all the NameRollAvg. [(1/7) + (14/7)] / 2 = &lt;STRONG&gt;1.07...&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171804#M18069</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T01:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171806#M18070</link>
      <description>&lt;P&gt;Yeah, no, still not buying it.&amp;nbsp; You already know that 14 is more than 1.&amp;nbsp; Fudging the average in that way is not constructive IMHO.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:18:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171806#M18070</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T01:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171808#M18072</link>
      <description>&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If one person sells a huge amount while every other person sells a small amount, I don't want this CategoryRollAvg to be greatly skewed by that. So, it may look like a lot of people are severely underperforming but in reality only one person is greatly performing . Again, I want to use these two metrics to compare one person to the rest of their peers. Unless I'm completely missing something math related...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nonetheless, is this possible to implement?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:32:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171808#M18072</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T01:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171810#M18073</link>
      <description>&lt;P&gt;Mathematically all you are doing is dividing the NameRollAvg by the count of names. What for?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:48:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171810#M18073</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T01:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171812#M18074</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dividing the Summation of all NamRollAvg by the number of names. I want to see on average how many sales/week per name in a category:&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;Name&lt;/TD&gt;&lt;TD&gt;NameRollAvg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Alice&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All belonging to the same category... The people in this category have around 3 sales per week. I am running this average not on raw sales but the derived NameRollAvg&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:57:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171812#M18074</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T01:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171814#M18075</link>
      <description>&lt;P&gt;Bob: 28&lt;/P&gt;&lt;P&gt;Alice: 35&lt;/P&gt;&lt;P&gt;Joe: 42&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;28+35+42 = 105&lt;/P&gt;&lt;P&gt;105 / 7 = 15&lt;/P&gt;&lt;P&gt;15 / 3 = 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same result as if you would do (4+5+6) / 3&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 02:02:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171814#M18075</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T02:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171824#M18078</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ah I see math fails me, or I fail math.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now on to&amp;nbsp; PowerBI, How would I use a filter to to get this CategoryRollAvg when a name is selected?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 02:18:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171824#M18078</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T02:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171826#M18079</link>
      <description>&lt;P&gt;put the category for the filter context in a variable, then in the calculate use an ALL() filter against the names and a category filter against your variable.&amp;nbsp; You probably need another variable to calculate the count distinct of names in your category.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 02:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171826#M18079</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T02:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171887#M18081</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240065" data-lia-user-login="t-dahen" class="lia-mention lia-mention-user"&gt;t-dahen&lt;/a&gt;&amp;nbsp;, If I understand your requirement correctly you want to calculate a running average of sales for a person regarding the category currently displayed. Then divide this number to the average of other peoples sales average in the last 7 days for this category: When viewed in excel it looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this case the running salesaverage for Alice (in the last 7 days for category B) is 4% higher than the average of the peoples runningsales average.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In here you see it working with some debug info:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This was made with the following dataset:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Pls mind that it uses a related date table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RunningAverageNameCategorySales = 
IF(NOT(ISBLANK(MIN('Table'[Sales])));
CALCULATE(AVERAGE('Table'[Sales]);ALLEXCEPT('Table';'Table'[Name];'Table'[Category]);DATESINPERIOD('Date'[Date]; MIN('Date'[Date]);-7;DAY));
BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PersonswithRunningsalesincat = 
CALCULATE(
    CONCATENATEX('Table';" RunningSales for: " &amp;amp; [Name] &amp;amp; ": " &amp;amp; [RunningAverageNameCategorySales] &amp;amp; "
");
ALLEXCEPT('Table';'Date';'Table'[Category]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AverageOfAverageRunningSalesinCat = 
CALCULATE(
    AVERAGEX('Table'; [RunningAverageNameCategorySales] );
ALLEXCEPT('Table';'Date';'Table'[Category]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComparingRunningAverageWithRestInCategory = [RunningAverageNameCategorySales]/[AverageOfAverageRunningSalesinCat]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Power BI file &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdhyEUdVdN-zEi6Diw?e=xGagtr" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excel file &lt;A href="https://1drv.ms/x/s!AvU6hhKLfmEcgdhwknz9f4HXE10Dtg?e=d5Y9Wj" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it help? Thumbs up would be great. Did it answer your question or solve the challenge? Please mark as &lt;STRONG&gt;solution&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&amp;nbsp;&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;</description>
      <pubDate>Sat, 20 Jun 2020 09:32:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1171887#M18081</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-20T09:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172062#M18095</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the response. Almost exactly what I need! Some questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't RunningAverageNameCategorySales and AverageOfAverageSalesinCat both be 22 for Bob on 6/19 and both be 18 on 6/20? For 6/19, Bob has had 22 Sales. Although there were 2 entries (10 + 12), these numbers should aggregate for the day. For 6/20, Bob has 14 Sales + 22 Sales (from 6/19). His rolling 7-day average on this day should be 18.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Ultimately, the visual I want looks something like this. Notice there is no Category selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But since there is no Category selected, there is no context and the percentages are messed up. Even though Alice and Bob are in different categories, I would still like to compare their "performance"&amp;nbsp; visually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 16:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172062#M18095</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T16:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172076#M18097</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240065" data-lia-user-login="t-dahen" class="lia-mention lia-mention-user"&gt;t-dahen&lt;/a&gt;&amp;nbsp;, I checked the numbers again, and they are correct, it can easily be verified with the 'debug' column 'PersonswithRunningsalesincat'. This of course assumes that category is available. Please note, I added some additional entries to your example data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to compare people by looking across the categories you will need to define an additional aggregate calculation to compare people. So per person, you could average their performance (the percentage score we have already made) across categories.&amp;nbsp;&lt;BR /&gt;The code would then be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ComparingRunningAverageWithRestInCategory = 
AVERAGEX(VALUES('Table'[Category]);
[RunningAverageNameCategorySales]
/
[AverageOfAverageRunningSalesinCat])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 18:19:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172076#M18097</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-20T18:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172086#M18098</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't Bob's RunningAverageNameCategorySales be 22 because we are looking at a daily level? This seems like you are counting Bob's two entries for 6/19 as two seperate Names in the Category.&amp;nbsp; This will be problematic if we introduce a new Name in Category A:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The AverageOfAverageRunningSalesinCat (Category A ) for 6/19 should be (22 + 15) / 2 = 18.5.&amp;nbsp; The duplicate "RunningSales for Bob: 11" is throwing things off.&lt;BR /&gt;-&lt;/P&gt;&lt;P&gt;That worked for the visual! Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 18:46:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172086#M18098</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-20T18:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172233#M18103</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240065" data-lia-user-login="t-dahen" class="lia-mention lia-mention-user"&gt;t-dahen&lt;/a&gt;&amp;nbsp;, I have given this some more time. This should work as you expect. Per person, the average category performance is calculated, by averaging performance per category. The performance per category is calculated by comparing the running average for the category by the average of all people selling in this category. I made a new &lt;U&gt;&lt;STRONG&gt;&lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdh11HSDidDv6dOwGA?e=2JWBSJ" target="_self"&gt;file&lt;/A&gt; &lt;/STRONG&gt;&lt;/U&gt;with detailed debug info allowing you to see exactly how the performance is calculated:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now the final calculation is:&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;_0_PersonPerformance = AVERAGEX(VALUES('Table'[Category]);[_1_Measure_ComparingRunningAverageWithRestInCategory])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_1_Measure_ComparingRunningAverageWithRestInCategory = [_2_Measure_RunningAverageNameCategorySales]/[_1_Measure_AverageOfAverageRunningSalesinCat]&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_1_Measure_AverageOfAverageRunningSalesinCat = 
CALCULATE(
    AVERAGEX('Table'; [_2_Measure_RunningAverageNameCategorySales] );
ALLEXCEPT('Table';'Date';'Table'[Category]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_2_Measure_RunningAverageNameCategorySales = 
IF(NOT(ISBLANK(MIN('Table'[Sales])));
CALCULATE(AVERAGE('Table'[Sales]);ALLEXCEPT('Table';'Table'[Name];'Table'[Category]);DATESINPERIOD('Date'[Date]; MIN('Date'[Date]);-7;DAY));
BLANK())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s. I added more sample data to ensure proper testing was possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please mark as &lt;STRONG&gt;solution&lt;/STRONG&gt; if this is what you were looking for. Appreciate thumbs up for the effort.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 06:33:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172233#M18103</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-21T06:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172502#M18123</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think I am being clear... Hear is an example of the calculations I would like to see. I would then like to plot the highlighted columns against dates. The 30.75 for Cateogry B&amp;nbsp; (6/20) Is coming from the Average of the RollAvg of people in Category B (Alice: 41.5 and Joe: 20). I got 41.5 for Alice's RollAvg (6/20) from averaging her total daily sales (13 and 70). Also, a Name will always be associated with one Category so I changed Alice's 6/20 Category to be B.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;RollAvg&lt;/TD&gt;&lt;TD&gt;CategoryAvg&lt;/TD&gt;&lt;TD&gt;RollAvg/Category&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Bob&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Bob&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Joe&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;1.071429&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Alice&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;0.928571&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Bob&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Joe&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;30.75&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;0.650407&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Alice&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20-Jun&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;Alice&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;41.5&lt;/TD&gt;&lt;TD&gt;30.75&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF6600"&gt;1.349593&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 21 Jun 2020 17:50:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172502#M18123</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-21T17:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172538#M18130</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240065" data-lia-user-login="t-dahen" class="lia-mention lia-mention-user"&gt;t-dahen&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;ah missed that summarization of the sales per day needs to be done first. Adjusted! output is now as expected:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Adjusted code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_2_Measure_RunningAverageNameCategorySales = 
var _CTfilter = DATESINPERIOD('Date'[Date]; MIN('Date'[Date]);-7;DAY)
var _CT = CALCULATETABLE(SUMMARIZE('Table';'Table'[Name];'Date'[Date];"sales"; CALCULATE(SUM('Table'[Sales]))) ;_CTfilter;ALLEXCEPT('Table';'Table'[Name];'Table'[Category]))
return
IF(NOT(ISBLANK(MIN('Table'[Sales])));
AVERAGEX(_CT;[sales]);
BLANK())&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_1_Measure_AverageOfAverageRunningSalesinCat = 
var _sumtbl = CALCULATETABLE(SUMMARIZE('Table';'Table'[Name];'Date'[Date];'Table'[Category]; "runningsales"; [_2_Measure_RunningAverageNameCategorySales]);ALLEXCEPT('Table';'Date';'Table'[Category]))
return
    AVERAGEX(_sumtbl; [runningsales])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New file available &lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdh2C3Uc_4V9jhN-AQ?e=h4ka9W" target="_self"&gt;here&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope we got it now?&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 19:02:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172538#M18130</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-21T19:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172540#M18131</link>
      <description>&lt;P&gt;Perfect!! Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 19:05:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172540#M18131</guid>
      <dc:creator>t-dahen</dc:creator>
      <dc:date>2020-06-21T19:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Categorical Rolling Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172548#M18133</link>
      <description>&lt;P&gt;Welcome!&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 19:18:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorical-Rolling-Average/m-p/1172548#M18133</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-21T19:18:30Z</dc:date>
    </item>
  </channel>
</rss>

