<?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: Get the average of a column value based on total count of values in ID column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2584439#M74276</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can try this DAX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure =&lt;/P&gt;
&lt;P&gt;DIVIDE (&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;SUM ( 'Table'[Duration] ),&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;CALCULATE (&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;COUNTROWS ( 'Table' ),&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;ALLEXCEPT ( 'Table', 'Table'[RunID] )&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&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;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 03:16:42 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-06-17T03:16:42Z</dc:date>
    <item>
      <title>Get the average of a column value based on total count of values in ID column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2577923#M73871</link>
      <description>&lt;P&gt;Hi,&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;In a table i have column called "&lt;STRONG&gt;Object&lt;/STRONG&gt;" which runs multiple times in a day and that runtime is captured in "&lt;STRONG&gt;StartTime&lt;/STRONG&gt;" &amp;amp; "&lt;STRONG&gt;EndTime&lt;/STRONG&gt;" columns, and the difference between the start and end time is captured in the "&lt;STRONG&gt;Duration&lt;/STRONG&gt;" Column.&lt;BR /&gt;Each object will be having multiple runid's which is captured in "&lt;STRONG&gt;RunID&lt;/STRONG&gt;" column which is a unique value.&lt;BR /&gt;For eg: Object AAA has two runid's called "111,222" and Object BBB has one runid called "333".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now i would like to get the average of each duration by count of that particular runid which is captured in "New Duration" column.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For eg&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The count of 111 runid is '10'. so for all those durations with runid 111 should be divided by the 10.&lt;/LI&gt;&lt;LI&gt;The count of 222 runid is '6'. so for all those durations with runid 222 should be divided by the 6.&lt;/LI&gt;&lt;LI&gt;The count of 333 runid is '8'. so for all those durations with runid 333 should be divided by the 8.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample screenshot for above query:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So since my Duration is "10" and total count of runid (111) is 10. So 10/10=1 that is my newduration.Similarly for all durations with runid's 111 should be divided bt 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to achieve this using DAX query??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am connecting to this table in powerbi via SQL direct query mode.&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;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 14:28:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2577923#M73871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-14T14:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get the average of a column value based on total count of values in ID column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2582453#M74135</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody help on this issue please??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 08:16:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2582453#M74135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-16T08:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get the average of a column value based on total count of values in ID column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2584439#M74276</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can try this DAX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure =&lt;/P&gt;
&lt;P&gt;DIVIDE (&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;SUM ( 'Table'[Duration] ),&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;CALCULATE (&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;COUNTROWS ( 'Table' ),&lt;/P&gt;
&lt;P class="lia-indent-padding-left-60px"&gt;ALLEXCEPT ( 'Table', 'Table'[RunID] )&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;)&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&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;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 03:16:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-average-of-a-column-value-based-on-total-count-of-values/m-p/2584439#M74276</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-17T03:16:42Z</dc:date>
    </item>
  </channel>
</rss>

