<?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 replicate TopN filter to make it Dynamic, show Top all time - but by week in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-replicate-TopN-filter-to-make-it-Dynamic-show-Top-all/m-p/3566338#M137480</link>
    <description>&lt;P&gt;I have resoloved this by using a RANKX, inside a calculate that removes the calendar context from RANKX, here's my solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR Number_to_Rank = [Top Number Selector Value]
VAR Val = [Total value]
RETURN
    IF (
        CALCULATE (
            RANKX ( ALLSELECTED ( 'TABLE 1'[TABLE Code] ), [Total value] ) &amp;lt;= Number_to_Rank,
            ALL ( 'RLS CALENDAR' )
        ),
        Val
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 04 Dec 2023 14:33:00 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2023-12-04T14:33:00Z</dc:date>
    <item>
      <title>DAX to replicate TopN filter to make it Dynamic, show Top all time - but by week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-replicate-TopN-filter-to-make-it-Dynamic-show-Top-all/m-p/3566098#M137471</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to replicate the function of a TopN visual level filter, so I can use it with a What If parameter to make it dynamic for the users of a report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to show the TopN of an item all time, but then break this down by the value that item acheived each week. I have tried several options, but I cannot seem to get it to ignore the date filter to find "all time" then re-apply the date filter to show the top N across time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an example, where 'MARKET SALES' is my fact table, 'TABLE 1'[TABLE Code] is the item I want to do the TopN for and I'm trying to filter the Calculate table by the whole calendar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMX (
    TOPN (
        [Top Number Selector Value],
        CALCULATETABLE (
            SUMMARIZE ( 'MARKET SALES', 'TABLE 1'[TABLE Code] ),
            ALL ( 'RLS CALENDAR' )
        ),
        [Total value], DESC
    ),
    [Total value]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this presents more items from 'TABLE 1'[TABLE Code] than the number selected in the TOP Number slicer.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 12:36:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-replicate-TopN-filter-to-make-it-Dynamic-show-Top-all/m-p/3566098#M137471</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2023-12-04T12:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to replicate TopN filter to make it Dynamic, show Top all time - but by week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-replicate-TopN-filter-to-make-it-Dynamic-show-Top-all/m-p/3566338#M137480</link>
      <description>&lt;P&gt;I have resoloved this by using a RANKX, inside a calculate that removes the calendar context from RANKX, here's my solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR Number_to_Rank = [Top Number Selector Value]
VAR Val = [Total value]
RETURN
    IF (
        CALCULATE (
            RANKX ( ALLSELECTED ( 'TABLE 1'[TABLE Code] ), [Total value] ) &amp;lt;= Number_to_Rank,
            ALL ( 'RLS CALENDAR' )
        ),
        Val
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 04 Dec 2023 14:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-replicate-TopN-filter-to-make-it-Dynamic-show-Top-all/m-p/3566338#M137480</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2023-12-04T14:33:00Z</dc:date>
    </item>
  </channel>
</rss>

