<?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: Use existing measure to generate Average Days Outstanding in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335141#M172128</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="897750" data-lia-user-login="MeganLouise93" class="lia-mention lia-mention-user"&gt;MeganLouise93&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate the average days outstanding, you need to take the current logic that calculates the days difference and aggregate it using the AVERAGEX function. This allows you to average the days difference across a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Days Outstanding =&lt;BR /&gt;AVERAGEX('Fact Finance',&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DATEDIFF(&lt;BR /&gt;'Fact Finance'[Document Date],TODAY(),DAY),&lt;BR /&gt;USERELATIONSHIP('Fact Finance'[Document Date], 'Dim Date'[Date])))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; are much appreciated!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Dharmendar S&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/in/dharmendar-s-b5b43463/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;LinkedIN&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2024 13:32:34 GMT</pubDate>
    <dc:creator>dharmendars007</dc:creator>
    <dc:date>2024-12-18T13:32:34Z</dc:date>
    <item>
      <title>Use existing measure to generate Average Days Outstanding</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4334954#M172115</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently have the following measure in our data model, which I'm hoping to use to build a measure for average days outstanding;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Time to Today =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Fact Finance'&lt;/SPAN&gt;&lt;SPAN&gt;[Document Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Fact Finance'&lt;/SPAN&gt;&lt;SPAN&gt;[Document Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Dim Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can anybody advise if/where in this I can add an average function?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Dec 2024 11:29:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4334954#M172115</guid>
      <dc:creator>MeganLouise93</dc:creator>
      <dc:date>2024-12-18T11:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Use existing measure to generate Average Days Outstanding</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335141#M172128</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="897750" data-lia-user-login="MeganLouise93" class="lia-mention lia-mention-user"&gt;MeganLouise93&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate the average days outstanding, you need to take the current logic that calculates the days difference and aggregate it using the AVERAGEX function. This allows you to average the days difference across a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Days Outstanding =&lt;BR /&gt;AVERAGEX('Fact Finance',&lt;BR /&gt;CALCULATE(&lt;BR /&gt;DATEDIFF(&lt;BR /&gt;'Fact Finance'[Document Date],TODAY(),DAY),&lt;BR /&gt;USERELATIONSHIP('Fact Finance'[Document Date], 'Dim Date'[Date])))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; are much appreciated!&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Dharmendar S&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.linkedin.com/in/dharmendar-s-b5b43463/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;LinkedIN&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 13:32:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335141#M172128</guid>
      <dc:creator>dharmendars007</dc:creator>
      <dc:date>2024-12-18T13:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Use existing measure to generate Average Days Outstanding</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335166#M172130</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="897750" data-lia-user-login="MeganLouise93" class="lia-mention lia-mention-user"&gt;MeganLouise93&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AVERAGEX('Fact Finance', [Time to Today] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will iterate through your 'Fact Finance' table and perform the [Time to Today] calculation at the row level. If you wanted to make this calculation more effiecient, you can place this calculation at a different level by providing it a particular attribute.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AVERAGEX( VALUES( 'Table'[Column]  ), [Time to Today] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will perform the calculation over less rows, providing there are some none unique rows in the column you use in the VALUES(&amp;nbsp; ), it will also provide a more specific average.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 13:44:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335166#M172130</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-18T13:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use existing measure to generate Average Days Outstanding</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335211#M172135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="897750" data-lia-user-login="MeganLouise93" class="lia-mention lia-mention-user"&gt;MeganLouise93&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To calculate the average days outstanding using the existing measure, you can wrap it with an aggregation function like AVERAGEX, which iterates over the relevant context. The modified measure would look like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average Days Outstanding =
AVERAGEX(
    'Fact Finance',
    CALCULATE(
        DATEDIFF(
            SELECTEDVALUE('Fact Finance'[Document Date]),
            TODAY(),
            DAY
        ),
        USERELATIONSHIP('Fact Finance'[Document Date], 'Dim Date'[Date])
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;In this measure, AVERAGEX is used to iterate over the rows of the 'Fact Finance' table and calculate the Time to Today value for each row. The CALCULATE function ensures that the USERELATIONSHIP between Document Date and the Dim Date is applied correctly. The result of these calculations is then averaged by AVERAGEX.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This approach ensures that the average is computed based on the context provided by the 'Fact Finance' table. If you need to restrict the calculation to specific rows, such as unpaid invoices, you can add additional filters within the CALCULATE function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you would like the analysis to align with the financially reported accounts receivable figure, I recommend using "Posting Date" instead of "Document Date."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 14:00:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4335211#M172135</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-12-18T14:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use existing measure to generate Average Days Outstanding</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4340721#M172362</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="897750" data-lia-user-login="MeganLouise93" class="lia-mention lia-mention-user"&gt;MeganLouise93&lt;/a&gt;&amp;nbsp;- did we resolve your issue? If we did, please select the appropriate solution, it helps with visibility for others and for SuperUsers to keep their status! Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 10:50:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-existing-measure-to-generate-Average-Days-Outstanding/m-p/4340721#M172362</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-23T10:50:48Z</dc:date>
    </item>
  </channel>
</rss>

