<?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 My Matrix Table Keeps Showing More than X rows despite Measures - How to fix? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-Matrix-Table-Keeps-Showing-More-than-X-rows-despite-Measures/m-p/4708077#M180317</link>
    <description>&lt;P&gt;Hi - Currently my table (named Overview) is displaying Sites (via distinct site table) and Customers (via distinct customer table) as the Matrix Table's rows and the&amp;nbsp;&lt;STRONG&gt;overall store sales + top 5 customer sales&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(depending on the time period picked).&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/x/c/55d0c8b13db740a6/EdfNZZU_csZFjp1NtIrJYLEBp3K0EiT-xbtb2InSwrUD6Q?e=ya5qng" target="_self" rel="nofollow noopener noreferrer"&gt;Data sheet hyperlink&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/c/55d0c8b13db740a6/Eferq2Kvg7VEg88HHBD7DDgBIxH3jfriyRNqYKFUF-NSJQ?e=7cJglB" target="_self" rel="nofollow noopener noreferrer"&gt;PBIX file hyperlink&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I'm experiencing a problem where&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;1. I can't seem to make a Top/Bottom 20 stores slicer (based off sales)&lt;/P&gt;&lt;P&gt;2. Adding Date columns to my Matrix Table rows removes my top 5 Customers row condition and instead shows 6 or more customer rows/exceeds query resources&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;To illustrate what i'm doing currently - I made the table's sales value by these measures:&lt;/P&gt;&lt;PRE&gt;Total Sales = SUM( Overview[Sales])&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Then i used this measure as the Matrix Table value:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;MEASURE-SALES = IF( ISINSCOPE( 'Unique Customers'[Customer] ), [Total Sales], CALCULATE( [Total Sales], REMOVEFILTERS( 'Unique Customers'[Customer] ) ) )&lt;/PRE&gt;&lt;P&gt;As mentioned before - i also made the table show each store's top 5 customers via this rank:&lt;/P&gt;&lt;PRE&gt;Customer Rank = VAR BaseTable = ADDCOLUMNS(
    CALCULATETABLE(
        SUMMARIZE(
            Overview, 
            'Unique Customers'[Customer],
            'Unique Stores'[Store]
        ),
        REMOVEFILTERS( 'Unique Customers' )
    ),
    "@val", [Total Sales]
)
VAR Result = RANK(
    SKIP,
    BaseTable,
    ORDERBY( [@val], DESC ),
    PARTITIONBY( 'Unique Stores'[Store] )
)
RETURN Result&lt;/PRE&gt;&lt;P&gt;then i set this measure as = 1 in the table's filter&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Customer is visible = VAR CustomerRank = [Customer Rank]
VAR Result = IF( ( CustomerRank &amp;lt;= 5 &amp;amp;&amp;amp; NOT ISBLANK( CustomerRank ) )
    || NOT ISINSCOPE( 'Unique Customers'[Customer] ), 1 )
RETURN Result&lt;/PRE&gt;&lt;P&gt;My date table is below for reference (capped at current month for YOY measure purposes not mentioned above):&lt;/P&gt;&lt;PRE&gt;Date = 
ADDCOLUMNS (
    CALENDAR (
        DATE (2023, 1, 1),
        DATE (2025, 4, 30)
    ),
    "Year", YEAR([Date]),
    "Year-Month", FORMAT([Date], "yyyy-MM"),
    "Year-Month sort", EOMONTH([Date], 0)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Would like if there was a test file sample on this if possible as i keep getting stuck/written measures i recieve return an error- the common problems i'm running into for 2. as mentioned before is:&lt;BR /&gt;- Query exceeds resource when Year-Month is added&lt;/P&gt;&lt;P&gt;- Rows exceed 5 customers when "Year" column is added / time range on slicer is picked&lt;/P&gt;</description>
    <pubDate>Tue, 27 May 2025 02:14:54 GMT</pubDate>
    <dc:creator>derekli17001</dc:creator>
    <dc:date>2025-05-27T02:14:54Z</dc:date>
    <item>
      <title>My Matrix Table Keeps Showing More than X rows despite Measures - How to fix?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-Matrix-Table-Keeps-Showing-More-than-X-rows-despite-Measures/m-p/4708077#M180317</link>
      <description>&lt;P&gt;Hi - Currently my table (named Overview) is displaying Sites (via distinct site table) and Customers (via distinct customer table) as the Matrix Table's rows and the&amp;nbsp;&lt;STRONG&gt;overall store sales + top 5 customer sales&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(depending on the time period picked).&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/x/c/55d0c8b13db740a6/EdfNZZU_csZFjp1NtIrJYLEBp3K0EiT-xbtb2InSwrUD6Q?e=ya5qng" target="_self" rel="nofollow noopener noreferrer"&gt;Data sheet hyperlink&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/c/55d0c8b13db740a6/Eferq2Kvg7VEg88HHBD7DDgBIxH3jfriyRNqYKFUF-NSJQ?e=7cJglB" target="_self" rel="nofollow noopener noreferrer"&gt;PBIX file hyperlink&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I'm experiencing a problem where&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;1. I can't seem to make a Top/Bottom 20 stores slicer (based off sales)&lt;/P&gt;&lt;P&gt;2. Adding Date columns to my Matrix Table rows removes my top 5 Customers row condition and instead shows 6 or more customer rows/exceeds query resources&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;To illustrate what i'm doing currently - I made the table's sales value by these measures:&lt;/P&gt;&lt;PRE&gt;Total Sales = SUM( Overview[Sales])&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Then i used this measure as the Matrix Table value:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;MEASURE-SALES = IF( ISINSCOPE( 'Unique Customers'[Customer] ), [Total Sales], CALCULATE( [Total Sales], REMOVEFILTERS( 'Unique Customers'[Customer] ) ) )&lt;/PRE&gt;&lt;P&gt;As mentioned before - i also made the table show each store's top 5 customers via this rank:&lt;/P&gt;&lt;PRE&gt;Customer Rank = VAR BaseTable = ADDCOLUMNS(
    CALCULATETABLE(
        SUMMARIZE(
            Overview, 
            'Unique Customers'[Customer],
            'Unique Stores'[Store]
        ),
        REMOVEFILTERS( 'Unique Customers' )
    ),
    "@val", [Total Sales]
)
VAR Result = RANK(
    SKIP,
    BaseTable,
    ORDERBY( [@val], DESC ),
    PARTITIONBY( 'Unique Stores'[Store] )
)
RETURN Result&lt;/PRE&gt;&lt;P&gt;then i set this measure as = 1 in the table's filter&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Customer is visible = VAR CustomerRank = [Customer Rank]
VAR Result = IF( ( CustomerRank &amp;lt;= 5 &amp;amp;&amp;amp; NOT ISBLANK( CustomerRank ) )
    || NOT ISINSCOPE( 'Unique Customers'[Customer] ), 1 )
RETURN Result&lt;/PRE&gt;&lt;P&gt;My date table is below for reference (capped at current month for YOY measure purposes not mentioned above):&lt;/P&gt;&lt;PRE&gt;Date = 
ADDCOLUMNS (
    CALENDAR (
        DATE (2023, 1, 1),
        DATE (2025, 4, 30)
    ),
    "Year", YEAR([Date]),
    "Year-Month", FORMAT([Date], "yyyy-MM"),
    "Year-Month sort", EOMONTH([Date], 0)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Would like if there was a test file sample on this if possible as i keep getting stuck/written measures i recieve return an error- the common problems i'm running into for 2. as mentioned before is:&lt;BR /&gt;- Query exceeds resource when Year-Month is added&lt;/P&gt;&lt;P&gt;- Rows exceed 5 customers when "Year" column is added / time range on slicer is picked&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 02:14:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-Matrix-Table-Keeps-Showing-More-than-X-rows-despite-Measures/m-p/4708077#M180317</guid>
      <dc:creator>derekli17001</dc:creator>
      <dc:date>2025-05-27T02:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: My Matrix Table Keeps Showing More than X rows despite Measures - How to fix?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-Matrix-Table-Keeps-Showing-More-than-X-rows-despite-Measures/m-p/4713904#M180553</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="718541" data-lia-user-login="derekli17001" class="lia-mention lia-mention-user"&gt;derekli17001&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed this question was open a few days so I decided to give it a try. I tried various approaches with DAX but I had the same issue with “ Query exceeds message… &amp;nbsp;“.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this reason I had a look via Power Query if this was possible and came up with the below. The general logic in Power Query for the attached file is &amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt; Add a key : StoreCustomerKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt; Add a key : StoreCustomerPeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt; Add a key : StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 20 Overall Store Table &amp;gt; Merge to Main Table via Store&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Bottom 20 Overall Store Table &amp;gt; Merge to Main Table via Store&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 5 Customers Per Store &amp;gt; Merge to Main Table with StoreCustomerKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 20 2023 Store Table &amp;gt; Merge to Main Table with StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Bottom 20 2023 Overall Store Table &amp;gt; Merge to Main Table StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 5 2023 Customers Per Store &amp;gt; Merge to Main Table with StoreCustomerPeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 20 2024 Store Table &amp;gt; Merge to Main Table with StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Bottom 20 2024 Overall Store Table &amp;gt; Merge to Main Table StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 5 2024 Customers Per Store &amp;gt; Merge to Main Table with StoreCustomerPeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 20 2025 Store Table &amp;gt; Merge to Main Table with StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Bottom 20 2025 Overall Store Table &amp;gt; Merge to Main Table StorePeriodKey&lt;/P&gt;&lt;P&gt;Overview Table &amp;gt;Duplicate &amp;gt; Create Top 5 2025 Customers Per Store &amp;gt; Merge to Main Table with StoreCustomerPeriodKey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Limitations : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-The period can be filtered by Year and not by Month as Month filters would be resource heavy with this mode. &amp;nbsp;Month is maybe possible ( maybe a python script in power query ) but I am not sure.&lt;/P&gt;&lt;P&gt;-Filters are a little bit too numerous but maybe you can clean that up with well placed slicers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Notes : &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Precise Power Query steps ( with extra custom columns, ranks, etc ) can be viewed if you download the file and connect to excel source.&lt;/P&gt;&lt;P&gt;-Linked only to your Overview table that you provided, but I think you can create relationships with your other tables where required&lt;/P&gt;&lt;P&gt;-Tested it and seems to work, but if you find something that is not correct please let me know . Will have another look.&lt;/P&gt;&lt;P&gt;-Below is a folder with the pbix file which you can link to you excel datasource which you provided in your question ( I worked off your datasource overview which you can link to yourt other tables ). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Folder with files" href="https://onedrive.live.com/?id=7FE50ADD519A5C5F%21sd0f47ffd27764d08a6440f163af11b09&amp;amp;cid=7FE50ADD519A5C5F" target="_blank" rel="noopener"&gt;Folder with files&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Top 20 Store Overall example :&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;Top 5 Customers per store&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;Example Store AS :&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;Top 5 Customer ( Overall ) Per store AS :&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;Top 5 Customer ( for year 2025 ) &amp;gt; Store AS :&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;Hope this helps&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 10:47:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/My-Matrix-Table-Keeps-Showing-More-than-X-rows-despite-Measures/m-p/4713904#M180553</guid>
      <dc:creator>antfr99</dc:creator>
      <dc:date>2025-05-30T10:47:01Z</dc:date>
    </item>
  </channel>
</rss>

