<?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 Calculating an average across a data table and a calendar table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763311#M85716</link>
    <description>&lt;P class=""&gt;I'm having some issues putting this down in DAX formula, I have a table that has number of hours worked by people and I want to have a basic average formula of these hours across all the calendar table data I have, except for saturdays and sundays. The table looks something like this:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Day Hours&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;TD&gt;31/02/2020&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;TD&gt;31/02/2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;And then the result would be an average of these hours across all those days in the calendar table where there's respective data for (aside weekend). Can anyone help me out with a way to approach this?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 06:32:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-13T06:32:15Z</dc:date>
    <item>
      <title>Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763311#M85716</link>
      <description>&lt;P class=""&gt;I'm having some issues putting this down in DAX formula, I have a table that has number of hours worked by people and I want to have a basic average formula of these hours across all the calendar table data I have, except for saturdays and sundays. The table looks something like this:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID Day Hours&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;TD&gt;31/02/2020&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;TD&gt;31/02/2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;And then the result would be an average of these hours across all those days in the calendar table where there's respective data for (aside weekend). Can anyone help me out with a way to approach this?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 06:32:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763311#M85716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T06:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763538#M85729</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , try a measure like&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calculate(average(Table[Hours]), filter(Table, weekday(Table[Date],2) &amp;lt;6 ) )&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 07:31:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763538#M85729</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-13T07:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763624#M85736</link>
      <description>&lt;P&gt;Thank you, this seems to work fine. I think I just need to find a way to address employees who are not working there anymore, or the average will be brought down, but this is in another table. Maybe I can do a SELECT COLUMNS variable before and use that as a table&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 07:55:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763624#M85736</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T07:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763635#M85737</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , depends on how data is stored. Refer current employee of this blog can help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 07:57:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763635#M85737</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-13T07:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763701#M85742</link>
      <description>&lt;P&gt;I have merged the column which tells me whether employees are dismissed or not. So right now it would look like the same as you mentioned but with that filter in addition. I can't make it however, because it says AVERAGEX can't work with Boolean types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AVERAGE&lt;/SPAN&gt;&lt;SPAN&gt;(Employees, Employees[Dismissed] &amp;lt;&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TRUE()),&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('Calendar', &lt;/SPAN&gt;&lt;SPAN&gt;WEEKDAY&lt;/SPAN&gt;&lt;SPAN&gt;('Calendar'[Date],&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Sep 2022 08:18:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2763701#M85742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-13T08:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an average across a data table and a calendar table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2766210#M85915</link>
      <description>&lt;P&gt;I have managed to resolve this one at the end, I used this formula:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var Employees = ADDCOLUMNS(Employees, "Daily Average Hours", CALCULATE(DIVIDE(SUM(Employees_Presence[Hours]), DISTINCTCOUNT(Employees_Presence[Date]))))
return

AVERAGEX(Employees, [Daily Average Hours])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goes to create a table where every row has the average between the sum of the hours worked and the days they worked. Then, I take that table and recall the column I created above with AVERAGEX to obtain the average of the average hours for each.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 06:35:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-average-across-a-data-table-and-a-calendar-table/m-p/2766210#M85915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T06:35:47Z</dc:date>
    </item>
  </channel>
</rss>

