<?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: Rank and Rank Increment/Decrement from selected week vs previous week in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244658#M20427</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="152440" data-lia-user-login="db1Intermtn" class="lia-mention lia-mention-user"&gt;db1Intermtn&lt;/a&gt;&amp;nbsp;, share data from week table or week and year column&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 10:49:21 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-07-23T10:49:21Z</dc:date>
    <item>
      <title>Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1241264#M20352</link>
      <description>&lt;P&gt;I have a table visual with branch, client and revenue information. The revenue is coming from a measure which is affected by the week selector slicer.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need to show Rank for selected week and rank increment/decrement from selected week's rank vs previous week from selected week. In snapshot, Rank # and Rank are the requirements.&lt;/P&gt;&lt;P&gt;I tried to create rank with AllSelected function but it is always affected by week slicer and I cannot get previous week rank to compare and put Rank increment/decrement. DAX I tried for Rank&lt;/P&gt;&lt;PRE&gt;Ranking  = 
RANKX(
            ALLSELECTED(V_TopClients),
            CALCULATE(SUM(V_TopClients[Revenue])
            )
        )&lt;/PRE&gt;&lt;P&gt;I have v_TopClients that has weekly revenue information linking to dimCalendar, Date tables.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 10:26:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1241264#M20352</guid>
      <dc:creator>db1Intermtn</dc:creator>
      <dc:date>2020-07-22T10:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1241377#M20355</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="152440" data-lia-user-login="db1Intermtn" class="lia-mention lia-mention-user"&gt;db1Intermtn&lt;/a&gt; , Create this week and last week measure and create rank on them and then use that rank to compare movement &lt;/P&gt;
&lt;P&gt;For week&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Rank Refer these links&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Icon&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 10:58:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1241377#M20355</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-22T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244606#M20426</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have calculated this week and previous week values with measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Week = CALCULATE ( SUM ( V_TopClients[GrossProfit] ), ALLSELECTED ( DimCalendar[WeekCaption] ) )&lt;BR /&gt;Previous Week = CALCULATE ( SUM ( v_TopClients[GrossProfit] ), ALLSELECTED ( 'DimCalendar' ), DATEADD('Date'[Date],-7,DAY))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also calculated the Rank for this week with Dax:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Ranking This Week = RANKX( ALLSELECTED(V_TopClients), CALCULATE(SUM(V_TopClients[GrossProfit]) ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now to show Rank increment/decrement based on the rank, I need previous week's rank. I am unable to get the rank for previous week. If I can get that, I was going to use the difference of this week's rank and previous week's rank to see the position change of the clients&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 10:37:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244606#M20426</guid>
      <dc:creator>db1Intermtn</dc:creator>
      <dc:date>2020-07-23T10:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244658#M20427</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="152440" data-lia-user-login="db1Intermtn" class="lia-mention lia-mention-user"&gt;db1Intermtn&lt;/a&gt;&amp;nbsp;, share data from week table or week and year column&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 10:49:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244658#M20427</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-23T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244773#M20429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the sample data here:&amp;nbsp;&amp;nbsp;&lt;A href="https://1drv.ms/u/s!Ave_-9o8DQVEgRq42F7E2tvw1s9_?e=0CRLM4" target="_blank"&gt;https://1drv.ms/u/s!Ave_-9o8DQVEgRq42F7E2tvw1s9_?e=0CRLM4&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have uploaded for 2 weeks for top clients data and 7 weeks for sample calendar table I have.&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;My requirement is to show rank increase/decrease/constant for the clients on the list based on selected week vs previous week rank.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 11:07:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1244773#M20429</guid>
      <dc:creator>db1Intermtn</dc:creator>
      <dc:date>2020-07-23T11:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rank and Rank Increment/Decrement from selected week vs previous week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1271921#M21445</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="152440" data-lia-user-login="db1Intermtn" class="lia-mention lia-mention-user"&gt;db1Intermtn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;write your measures like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;this week =
VAR _maxWeekData =
    CALCULATE ( MAX ( TopClients[CalendarWeekKey] ), ALL ( TopClients ) )
RETURN
    CALCULATE (
        SUM ( TopClients[GrossProfit] ),
        FILTER ( ALL ( DimCalendar ), DimCalendar[CalendarWeekKey] = _maxWeekData )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;previous week =
VAR _maxWeekData =
    CALCULATE ( MAX ( TopClients[CalendarWeekKey] ), ALL ( TopClients ) )
VAR _previousWeek =
    CALCULATE (
        MAX ( TopClients[CalendarWeekKey] ),
        FILTER ( ALL ( TopClients ), TopClients[CalendarWeekKey] &amp;lt; _maxWeekData )
    )
RETURN
    CALCULATE (
        SUM ( TopClients[GrossProfit] ),
        FILTER ( ALL ( DimCalendar ), DimCalendar[CalendarWeekKey] = _previousWeek )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ranking This Week = RANKX( ALL(TopClients), [this week] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ranking previous Week = RANKX( ALL(TopClients), [previous week] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Sturla&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accepting it as the solution. Kudos are nice too.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2020 14:48:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-and-Rank-Increment-Decrement-from-selected-week-vs-previous/m-p/1271921#M21445</guid>
      <dc:creator>sturlaws</dc:creator>
      <dc:date>2020-08-04T14:48:12Z</dc:date>
    </item>
  </channel>
</rss>

