<?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 Increased, Decreased, No Change in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Increased-Decreased-No-Change/m-p/3824594#M1074</link>
    <description>&lt;P&gt;Came out of this post here:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Looking-for-help-with-measures-please/m-p/3824149#M1236071" target="_blank" rel="noopener"&gt;Re: Looking for help with measures please - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, given a set of date-series data, how many customers have increased their score, descreased their score, or remained unchanged from their first data point to their last data point. Also calculates the percentage that have increased, decreased, or remained the same as well as the average number of data points for customers that have increased, decreased, or remained the same. The measures below are for increases, the other measures are nearly identical and are in the attached PBIX file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated to include a variation that excludes customers with only 1 appointment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Icreased Measure = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                DISTINCT( 'Table'[Customer ID] ),
                "__FirstDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __FirstDate = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __FirstScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __FirstDate ), [Score] )
                RETURN
                    __FirstScore,
                "__LastDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __LastDate = MAXX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __LastScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __LastDate ), [Score] )
                RETURN
                    __LastScore
            ),
            "__Diff", [__LastDateScore] - [__FirstDateScore]
        )
    VAR __Result = COUNTROWS( FILTER( __Table, [__Diff] &amp;gt; 0 ) )
RETURN
    __Result&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Total Percent Increased Measure = DIVIDE( [Total Icreased Measure], COUNTROWS(DISTINCT('Table'[Customer ID])), 0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Average Appointments Increased Measure = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                DISTINCT( 'Table'[Customer ID] ),
                "__FirstDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __FirstDate = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __FirstScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __FirstDate ), [Score] )
                RETURN
                    __FirstScore,
                "__LastDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __LastDate = MAXX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __LastScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __LastDate ), [Score] )
                RETURN
                    __LastScore
            ),
            "__Diff", [__LastDateScore] - [__FirstDateScore]
        )
    VAR __IncreasedCustomers = DISTINCT( SELECTCOLUMNS( FILTER( __Table, [__Diff] &amp;gt; 0 ), "__ID", [Customer ID] ) )
    VAR __Result = AVERAGEX( SUMMARIZE( FILTER( 'Table', [Customer ID] IN __IncreasedCustomers ), [Customer ID], "__Count", COUNTROWS('Table') ), [__Count] )
RETURN
    __Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiZmYxMTUxYjUtMTg2Ni00OTcyLWFkMzQtMmY0ZDBhMmYzMTFkIiwidCI6Ijg3NDlmOWI5LWYzMmQtNDdhMS1hMjI0LTM2OTQxOGFlMmY1MSJ9&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 14:44:06 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-04-11T14:44:06Z</dc:date>
    <item>
      <title>Increased, Decreased, No Change</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Increased-Decreased-No-Change/m-p/3824594#M1074</link>
      <description>&lt;P&gt;Came out of this post here:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Looking-for-help-with-measures-please/m-p/3824149#M1236071" target="_blank" rel="noopener"&gt;Re: Looking for help with measures please - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, given a set of date-series data, how many customers have increased their score, descreased their score, or remained unchanged from their first data point to their last data point. Also calculates the percentage that have increased, decreased, or remained the same as well as the average number of data points for customers that have increased, decreased, or remained the same. The measures below are for increases, the other measures are nearly identical and are in the attached PBIX file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated to include a variation that excludes customers with only 1 appointment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Icreased Measure = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                DISTINCT( 'Table'[Customer ID] ),
                "__FirstDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __FirstDate = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __FirstScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __FirstDate ), [Score] )
                RETURN
                    __FirstScore,
                "__LastDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __LastDate = MAXX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __LastScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __LastDate ), [Score] )
                RETURN
                    __LastScore
            ),
            "__Diff", [__LastDateScore] - [__FirstDateScore]
        )
    VAR __Result = COUNTROWS( FILTER( __Table, [__Diff] &amp;gt; 0 ) )
RETURN
    __Result&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Total Percent Increased Measure = DIVIDE( [Total Icreased Measure], COUNTROWS(DISTINCT('Table'[Customer ID])), 0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Average Appointments Increased Measure = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                DISTINCT( 'Table'[Customer ID] ),
                "__FirstDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __FirstDate = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __FirstScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __FirstDate ), [Score] )
                RETURN
                    __FirstScore,
                "__LastDateScore",
                    VAR __CustomerID = [Customer ID]
                    VAR __LastDate = MAXX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID ), [Date] )
                    VAR __LastScore = MINX( FILTER( ALLSELECTED( 'Table'), [Customer ID] = __CustomerID &amp;amp;&amp;amp; [Date] = __LastDate ), [Score] )
                RETURN
                    __LastScore
            ),
            "__Diff", [__LastDateScore] - [__FirstDateScore]
        )
    VAR __IncreasedCustomers = DISTINCT( SELECTCOLUMNS( FILTER( __Table, [__Diff] &amp;gt; 0 ), "__ID", [Customer ID] ) )
    VAR __Result = AVERAGEX( SUMMARIZE( FILTER( 'Table', [Customer ID] IN __IncreasedCustomers ), [Customer ID], "__Count", COUNTROWS('Table') ), [__Count] )
RETURN
    __Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiZmYxMTUxYjUtMTg2Ni00OTcyLWFkMzQtMmY0ZDBhMmYzMTFkIiwidCI6Ijg3NDlmOWI5LWYzMmQtNDdhMS1hMjI0LTM2OTQxOGFlMmY1MSJ9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 14:44:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Increased-Decreased-No-Change/m-p/3824594#M1074</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-04-11T14:44:06Z</dc:date>
    </item>
  </channel>
</rss>

