<?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: DAX to Count IDs that have not retained on their previous scores in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3559011#M137114</link>
    <description>&lt;P&gt;Thanks for putting in efforts. I need a measure that will give me count of IDs within the selected date range. Also, do not want to create another table to use PartitionBy.&lt;BR /&gt;&lt;BR /&gt;Pls suggest some other solution. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 13:53:47 GMT</pubDate>
    <dc:creator>AlwaysAGooner</dc:creator>
    <dc:date>2023-11-29T13:53:47Z</dc:date>
    <item>
      <title>DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3539425#M136022</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a need to identify IDs in my data who have gone backwards on scoring and those who have retained their scores if interviewd more than once. Set of IDs (Individuals) are evaluted for a Brand and based on respnses a scoring value is assigned.&lt;BR /&gt;&lt;BR /&gt;There could be a scenario where some Individuals have scored less than what they had scored previously, i.e. I scored 3 on in Apr'23 and Aug I scored 2. And then there would be case of those who have retained their scores.&lt;BR /&gt;All his must be responsive to date slicer, so the counting should happen only within the selected date range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So to summarize, the requirements are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Identify Ids that have scored than what they scored previously (have degraged). One such case highlighted in the image&lt;BR /&gt;2.&amp;nbsp;Identify Ids that have retained their score&lt;BR /&gt;&lt;BR /&gt;Any suggestion/leads will be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 16:05:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3539425#M136022</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-17T16:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3540027#M136035</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;Apply conditional table formatting in Power BI - Power BI | Microsoft Learn&lt;/A&gt;&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;&lt;img /&gt;&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;LI-CODE lang="markup"&gt;Score measure: = 
SUM( Data[Score] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Condition measure: = 
VAR _prevscore =
    CALCULATE (
        [Score measure:],
        OFFSET (
            -1,
            SUMMARIZE ( ALL ( Data ), Brand[ID], Brand[Brand], 'Calendar'[Date] ),
            ORDERBY ( 'Calendar'[Date], ASC ),
            ,
            PARTITIONBY ( Brand[Brand], Brand[ID] )
        )
    )
VAR _condition =
    IF (
        NOT ISBLANK ( [Score measure:] ),
        IF ( [Score measure:] &amp;lt; _prevscore, -1, 0 )
    )
RETURN
    _condition&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2023 05:14:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3540027#M136035</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-11-18T05:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3540086#M136039</link>
      <description>&lt;P&gt;Easy enough&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Nov 2023 07:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3540086#M136039</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2023-11-18T07:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3541748#M136106</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="587906" data-lia-user-login="AlwaysAGooner" class="lia-mention lia-mention-user"&gt;AlwaysAGooner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try code as below to create measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IDs Retained Score = 
VAR _SCORELIST =
    SUMMARIZE (
        'Table',
        'Table'[ID],
        "Count",
            CALCULATE (
                DISTINCTCOUNT ( 'Table'[Score] ),
                ALLEXCEPT ( 'Table', DimDate[Date], 'Table'[ID] )
            )
    )
RETURN
    COUNTX ( FILTER ( _SCORELIST, [Count] = 1 ), [ID] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Count Degraged = 
VAR _SCORELIST =
    SUMMARIZE (
        'Table',
        'Table'[ID],
        "Current",
            CALCULATE (
                SUM ( 'Table'[Score] ),
                FILTER ( 'Table', 'Table'[Date] = MAX ( 'Table'[Date] ) )
            ),
        "Previous",
            CALCULATE (
                SUM ( 'Table'[Score] ),
                FILTER (
                    'Table',
                    'Table'[Date]
                        = MAXX (
                            FILTER (
                                ALLEXCEPT ( 'Table', 'Table'[ID], DimDate[Date] ),
                                'Table'[Date] &amp;lt; MAX ( 'Table'[Date] )
                            ),
                            'Table'[Date]
                        )
                )
            )
    )
RETURN
    COUNTAX ( FILTER ( _SCORELIST, [Current] &amp;lt; [Previous] ), [ID] )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&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;BR /&gt;Rico Zhou&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>Mon, 20 Nov 2023 07:04:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3541748#M136106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-20T07:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3543850#M136246</link>
      <description>&lt;P&gt;Need it as a measure that would return Unquie count if IDs&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 06:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3543850#M136246</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-21T06:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3556674#M136938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code works fine. May I ask your help again to also calulate 'Upgraded'? Count of those ids who have mutiple entries and have gained on the score since last evaluated, i.e. Current Score &amp;gt; Previous Score.&lt;BR /&gt;&lt;BR /&gt;I tried making the operator change in the Degraedd code but that takes into account those ids as well who have been evaluted just once.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 14:30:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3556674#M136938</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-28T14:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3556802#M136950</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 15:24:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3556802#M136950</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-28T15:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3558296#M137066</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code works fine. May I ask help again to also calulate 'Upgraded'? Count of those ids who have mutiple entries and have gained on the score since last evaluated, i.e. Current Score &amp;gt; Previous Score.&lt;BR /&gt;&lt;BR /&gt;I tried making the operator change in the 'Degraded' code but that takes into account those ids as well who have been evaluted just once.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 09:00:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3558296#M137066</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-29T09:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to Count IDs that have not retained on their previous scores</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3559011#M137114</link>
      <description>&lt;P&gt;Thanks for putting in efforts. I need a measure that will give me count of IDs within the selected date range. Also, do not want to create another table to use PartitionBy.&lt;BR /&gt;&lt;BR /&gt;Pls suggest some other solution. Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 13:53:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-Count-IDs-that-have-not-retained-on-their-previous-scores/m-p/3559011#M137114</guid>
      <dc:creator>AlwaysAGooner</dc:creator>
      <dc:date>2023-11-29T13:53:47Z</dc:date>
    </item>
  </channel>
</rss>

