<?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 show % change from highest value to second highest in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2805800#M88481</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336152" data-lia-user-login="NB689" class="lia-mention lia-mention-user"&gt;NB689&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked your code and I think you need to use ALL() function in your filter.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Login Change by Day =
VAR _HourofMax =
    SUMX (
        FILTER ( ALL ( 'Date Range' ), 'Date Range'[Date] = [Max Login Date] ),
        [Hours Logged In]
    )
VAR _HourofMin =
    SUMX (
        FILTER ( ALL ( 'Date Range' ), 'Date Range'[Date] = [Min Date] ),
        [Hours Logged In]
    )
RETURN
    DIVIDE ( _HourofMax - _HourofMin, _HourofMin )&lt;/LI-CODE&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;</description>
    <pubDate>Thu, 29 Sep 2022 09:38:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-29T09:38:29Z</dc:date>
    <item>
      <title>Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2801134#M88127</link>
      <description>&lt;P&gt;Hello I have the below data and I would like to create a card that show the percent change from the highest date value (9/18) to the second highest (9/17). So my intention would to be a value that shows -3.077 %.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Hours Logged In&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/16/2022&lt;/TD&gt;&lt;TD&gt;9.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/17/2022&lt;/TD&gt;&lt;TD&gt;6.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/18/2022&lt;/TD&gt;&lt;TD&gt;6.3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Hours Logged In is a calculated measure in the table "Non Overlapping" and Date is in the Date Range table with a relationship tied to the other table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 21:34:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2801134#M88127</guid>
      <dc:creator>NB689</dc:creator>
      <dc:date>2022-09-27T21:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2801378#M88144</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336152" data-lia-user-login="NB689" class="lia-mention lia-mention-user"&gt;NB689&lt;/a&gt; , &lt;/P&gt;
&lt;P&gt;Try measure like&lt;/P&gt;
&lt;P&gt;Var _max = maxx(allselected(Table), Table[Date])&lt;/P&gt;
&lt;P&gt;Var _min = maxx(filter( allselected(Table), Table[Date] &amp;lt;_max), Table[Date] )&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;Divide( calculate( sum(Table[Value]), filter('Table', 'Table'[Date] =_max)) - calculate( sum(Table[Value]), filter('Table', 'Table'[Date] =_min)) ,calculate( sum(Table[Value]), filter('Table', 'Table'[Date] =_min))&amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 01:46:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2801378#M88144</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-28T01:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2803308#M88294</link>
      <description>&lt;P&gt;I'm not able to pull my value into the return expression. I believe since it is a measure that represents a column. Not sure if I need to add a SELECTED statement for that to work?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 15:30:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2803308#M88294</guid>
      <dc:creator>NB689</dc:creator>
      <dc:date>2022-09-28T15:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2803425#M88307</link>
      <description>&lt;P&gt;I made some more progress by using Sumx instead of Sum since my value is a measure. But my calculation is way off at 45%. Also I split this out into 3 different measures instead of using variables to help me troubleshoot. The max and min login days are working as they should.&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;</description>
      <pubDate>Wed, 28 Sep 2022 16:16:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2803425#M88307</guid>
      <dc:creator>NB689</dc:creator>
      <dc:date>2022-09-28T16:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2805800#M88481</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="336152" data-lia-user-login="NB689" class="lia-mention lia-mention-user"&gt;NB689&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I checked your code and I think you need to use ALL() function in your filter.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Login Change by Day =
VAR _HourofMax =
    SUMX (
        FILTER ( ALL ( 'Date Range' ), 'Date Range'[Date] = [Max Login Date] ),
        [Hours Logged In]
    )
VAR _HourofMin =
    SUMX (
        FILTER ( ALL ( 'Date Range' ), 'Date Range'[Date] = [Min Date] ),
        [Hours Logged In]
    )
RETURN
    DIVIDE ( _HourofMax - _HourofMin, _HourofMin )&lt;/LI-CODE&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;</description>
      <pubDate>Thu, 29 Sep 2022 09:38:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2805800#M88481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-29T09:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dax to show % change from highest value to second highest</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2806582#M88574</link>
      <description>&lt;P&gt;That is working great now, thank you! Just trying to build my understanding, how do you know when you need to apply ALL when using a filter? I think this is due to my 'Hours Logged In' being a measure.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 13:40:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-to-show-change-from-highest-value-to-second-highest/m-p/2806582#M88574</guid>
      <dc:creator>NB689</dc:creator>
      <dc:date>2022-09-29T13:40:17Z</dc:date>
    </item>
  </channel>
</rss>

