<?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 Average difference between two MIN dates (Summarizing Measures with Averages) in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/415728#M190875</link>
    <description>&lt;P&gt;Hi Guys,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;First post.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a measure that calculates the average difference between dates. To make things more complicated, these dates fields come from tables that contain multiple rows for the same "user" and I have to first find the MIN of those dates. On top of that, the measure must determine which dates are available and pick the two to subtract.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Measure 1 = Min(Table1[Date1])&lt;BR /&gt;Measure 2 = Min(Table2[Date2])&lt;BR /&gt;Measure 3 = Min(Table3[Date3])&lt;BR /&gt;&lt;BR /&gt;Measure 4 = IF(ISBLANK([Measure 1]),[Measure 2]-[Measure 3],[Measure 1]-[Measure 3])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When I drop&amp;nbsp;Measure 4 into a table to see the value for each user, the values are correct. However, if I remove the User ID and replace it with the Year the user signed up, the values for Measure 4 can't be shown as user averages for those years. The years are not a date used in the measures and reside on the same table as the User ID.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can I summarise a measure of this kind as an average?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Maybe I'm taking the wrong approach to this problem.&lt;/P&gt;</description>
    <pubDate>Fri, 11 May 2018 21:15:42 GMT</pubDate>
    <dc:creator>SebL</dc:creator>
    <dc:date>2018-05-11T21:15:42Z</dc:date>
    <item>
      <title>Average difference between two MIN dates (Summarizing Measures with Averages)</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/415728#M190875</link>
      <description>&lt;P&gt;Hi Guys,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;First post.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a measure that calculates the average difference between dates. To make things more complicated, these dates fields come from tables that contain multiple rows for the same "user" and I have to first find the MIN of those dates. On top of that, the measure must determine which dates are available and pick the two to subtract.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Measure 1 = Min(Table1[Date1])&lt;BR /&gt;Measure 2 = Min(Table2[Date2])&lt;BR /&gt;Measure 3 = Min(Table3[Date3])&lt;BR /&gt;&lt;BR /&gt;Measure 4 = IF(ISBLANK([Measure 1]),[Measure 2]-[Measure 3],[Measure 1]-[Measure 3])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When I drop&amp;nbsp;Measure 4 into a table to see the value for each user, the values are correct. However, if I remove the User ID and replace it with the Year the user signed up, the values for Measure 4 can't be shown as user averages for those years. The years are not a date used in the measures and reside on the same table as the User ID.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can I summarise a measure of this kind as an average?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Maybe I'm taking the wrong approach to this problem.&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 21:15:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/415728#M190875</guid>
      <dc:creator>SebL</dc:creator>
      <dc:date>2018-05-11T21:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Average difference between two MIN dates (Summarizing Measures with Averages)</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/415842#M190926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="64276" data-lia-user-login="SebL" class="lia-mention lia-mention-user"&gt;SebL&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your description,&amp;nbsp;you are wanting to calculate the average of the expression in [Measure 4] over&amp;nbsp;Users in the current filter context.&amp;nbsp;You can use AVERAGEX to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this should do the trick (I'm guessing the table containing the User&amp;nbsp;ID column table is called Users):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Measure 4 Average over Users =
AVERAGEX (
    VALUES ( Users[User ID] ),
    IF (
        ISBLANK ( [Measure 1] ),
        [Measure 2] - [Measure 3],
        [Measure 1] - [Measure 3]
    )
)&lt;/PRE&gt;&lt;P&gt;Or this should work as well:&lt;/P&gt;&lt;PRE&gt;Measure 4 Average over Users v2 =
AVERAGEX (
    Users,
    IF (
        ISBLANK ( [Measure 1] ),
        [Measure 2] - [Measure 3],
        [Measure 1] - [Measure 3]
    )
)&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Owen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 07:34:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/415842#M190926</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2018-05-12T07:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Average difference between two MIN dates (Summarizing Measures with Averages)</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/416807#M191452</link>
      <description>&lt;P&gt;Thanks, this worked perfectly.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm wondering if I could add a follow-up question.&lt;BR /&gt;&lt;BR /&gt;I now have the average number of days per user being displayed over time. How would I go about creating a measure that displays the&amp;nbsp;percentage of those users that are under a certain threshold of days?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 15:49:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/416807#M191452</guid>
      <dc:creator>SebL</dc:creator>
      <dc:date>2018-05-14T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Average difference between two MIN dates (Summarizing Measures with Averages)</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/418471#M192255</link>
      <description>&lt;P&gt;That's good news :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming you still have [Measure 4]&amp;nbsp;which can be&amp;nbsp;evaluated per User.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate % users under a certain threshold, you can do something like this:&lt;/P&gt;&lt;PRE&gt;Users under threshold % =
VAR UsersUnderThreshold =
    COUNTROWS ( FILTER ( VALUES ( Users[User ID] ), [Measure 4] &amp;lt; Threshold ) )
VAR TotalUsers =
    DISTINCTCOUNT ( Users[User ID] )
RETURN
    DIVIDE ( UsersUnderThreshold, TotalUsers )&lt;/PRE&gt;&lt;P&gt;Does that work for you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 09:27:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/418471#M192255</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2018-05-16T09:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Average difference between two MIN dates (Summarizing Measures with Averages)</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/418905#M192452</link>
      <description>&lt;P&gt;That worked perfectly.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 17:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Average-difference-between-two-MIN-dates-Summarizing-Measures/m-p/418905#M192452</guid>
      <dc:creator>SebL</dc:creator>
      <dc:date>2018-05-16T17:38:53Z</dc:date>
    </item>
  </channel>
</rss>

