<?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 Promedio de asistencias in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2986967#M100283</link>
    <description>&lt;P&gt;Hola, tengo una tabla de asistencias con fechas de diferentes meses que incluye el código de cada socios que ingresa, la fecha y la hora, y luce algo así:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Me interesa conocer las horas pico donde ingresa la mayor cantidad de socios, para ello dividí el día laboral en 3:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Utilicé el siguiente comando para poder observar cuántos socios ingresan por día en cada uno de los 3 horarios (ojo, un socio puede ingresar más de una vez en un día, o ingresar, salir y volver a ingresar en el mismo momento, por lo que me interesa que el conteo de los socios sea distintivo):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Y esto es lo que me arroja dicho comando:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ahora que tengo esto, estoy interesado en conocer el promedio de ingresos por día, por ejemplo, el jueves ingresaron 3559 socios de 4 am a 8 am, suponiendo que dicho mes hubo 5 jueves, el promedio sería: 3559/5 = 772, pero no sé cómo hacerlo, lo intenté con Averagex pero me da resultados erróneos, o tal vez estoy aplicando mal el comando. Quisiera poder agregar dicha medida a la tabla que está arriba, en el ejemplo dado poder ver:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Jueves&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Total&amp;nbsp; &amp;nbsp; &amp;nbsp; Promedio&lt;BR /&gt;4 am - 8 am&amp;nbsp; &amp;nbsp; &amp;nbsp; 3559&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;772&lt;BR /&gt;¿Alguna idea para poder hacer esto? Desde ya muchas gracias por el apoyo.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2022 17:52:16 GMT</pubDate>
    <dc:creator>jsama</dc:creator>
    <dc:date>2022-12-23T17:52:16Z</dc:date>
    <item>
      <title>Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2986967#M100283</link>
      <description>&lt;P&gt;Hola, tengo una tabla de asistencias con fechas de diferentes meses que incluye el código de cada socios que ingresa, la fecha y la hora, y luce algo así:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Me interesa conocer las horas pico donde ingresa la mayor cantidad de socios, para ello dividí el día laboral en 3:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Utilicé el siguiente comando para poder observar cuántos socios ingresan por día en cada uno de los 3 horarios (ojo, un socio puede ingresar más de una vez en un día, o ingresar, salir y volver a ingresar en el mismo momento, por lo que me interesa que el conteo de los socios sea distintivo):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Y esto es lo que me arroja dicho comando:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ahora que tengo esto, estoy interesado en conocer el promedio de ingresos por día, por ejemplo, el jueves ingresaron 3559 socios de 4 am a 8 am, suponiendo que dicho mes hubo 5 jueves, el promedio sería: 3559/5 = 772, pero no sé cómo hacerlo, lo intenté con Averagex pero me da resultados erróneos, o tal vez estoy aplicando mal el comando. Quisiera poder agregar dicha medida a la tabla que está arriba, en el ejemplo dado poder ver:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Jueves&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Total&amp;nbsp; &amp;nbsp; &amp;nbsp; Promedio&lt;BR /&gt;4 am - 8 am&amp;nbsp; &amp;nbsp; &amp;nbsp; 3559&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;772&lt;BR /&gt;¿Alguna idea para poder hacer esto? Desde ya muchas gracias por el apoyo.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 17:52:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2986967#M100283</guid>
      <dc:creator>jsama</dc:creator>
      <dc:date>2022-12-23T17:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2986974#M100284</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="445496" data-lia-user-login="jsama" class="lia-mention lia-mention-user"&gt;jsama&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You already have the "Total" so you only need to count the number of "jueves".&amp;nbsp; What field are you using for the day? A COUNT of that field should suffice. Something like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;COUNT(DateT[WeekDay])&lt;/LI-CODE&gt;
&lt;P&gt;Then you can divide the total by this value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 18:01:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2986974#M100284</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-23T18:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2987185#M100305</link>
      <description>&lt;P&gt;I created a column for the field day using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Day = format(Date, "dddd")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(Date[Day])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it gives me the total amount of rows that I have, so when I divide the total by this new value it shows me this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the total access of an specific day divided by the total of access.&lt;/P&gt;&lt;P&gt;In the example that I gave, I need the total access of thursday divided by the total of thursday in a period of time. For example, in august there were 4 thursdays, and the total access in august was 3559, so its going to be 3559/4 =&amp;nbsp; 890&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:28:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2987185#M100305</guid>
      <dc:creator>jsama</dc:creator>
      <dc:date>2022-12-23T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2987197#M100308</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="445496" data-lia-user-login="jsama" class="lia-mention lia-mention-user"&gt;jsama&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the matrix visual you are showing&amp;nbsp; being filterd for August in one specific year? If so, it should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the pbix?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 20:45:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2987197#M100308</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-23T20:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2988280#M100419</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="445496" data-lia-user-login="jsama" class="lia-mention lia-mention-user"&gt;jsama&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Create a calendar table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;table=calendar(date(2020,1,1),date(2022,12,31))&lt;/LI-CODE&gt;
&lt;P&gt;Then create columns.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;month=month(table[date])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Year=year(table[date])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;weekday=weekday(table[date])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;weekday count =
CALCULATE (
    COUNT ( table[weekday] ),
    FILTER (
        table,
        table[month] = EARLIER ( table[month] )
            &amp;amp;&amp;amp; table[year] = EARLIER ( table[year] )
            &amp;amp;&amp;amp; table[weekday] = EARLIER ( table[weekday] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create relationships between the tables.&lt;/P&gt;
&lt;P&gt;Then create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;measure=[total Ingresos]/max(table[weekday count])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards&lt;BR /&gt;Community Support Team _ Polly&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 05:32:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/2988280#M100419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-26T05:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/3001530#M101361</link>
      <description>&lt;P&gt;I just have a final problem, I did what you told me, and it helped me a lot, but when I use the measure&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;measure=[total Ingresos]/max(table[weekday count])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It always gives me the max number of the month, and thats not always right, let me give you an example:&lt;/P&gt;&lt;P&gt;In August 2022 there where 4 sundays, so when I divide the total of access it should be: 307/4 = 76.7, but the Max number of the column "weekday count" its 5, it divides the total of access by 5. If there were 4 sundays I need to divide the total of access by 4.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 16:44:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/3001530#M101361</guid>
      <dc:creator>jsama</dc:creator>
      <dc:date>2023-01-04T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Promedio de asistencias</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/3002113#M101400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="445496" data-lia-user-login="jsama" class="lia-mention lia-mention-user"&gt;jsama&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please have a try.&lt;/P&gt;
&lt;P&gt;Change the weekday column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;weekday=weekday(table[date],2)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;weekday count =
CALCULATE (
    COUNT ( table[weekday] ),
    FILTER (
        table,
        table[month] = EARLIER ( table[month] )
            &amp;amp;&amp;amp; table[year] = EARLIER ( table[year] )
            &amp;amp;&amp;amp; table[weekday] = 7
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 01:17:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Promedio-de-asistencias/m-p/3002113#M101400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-05T01:17:00Z</dc:date>
    </item>
  </channel>
</rss>

