<?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: Filter a Matrix table by first row in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4240650#M167875</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="823450" data-lia-user-login="PowerBIUser007" class="lia-mention lia-mention-user"&gt;PowerBIUser007&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't know much about your data model, but you can try the following expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CustomerCMFilter = 
IF (
    HASONEVALUE('Customer'[CustomerName]),
    IF (
        [CM%] &amp;lt; 0.05,
        1,
        0
    ),
    1
)

DisplayMeasure = 
IF (
    ISINSCOPE('Customer'[CustomerName]),
    IF (
        [CustomerCMFilter] = 1,
        [Turnover],  // Replace with the measure you want to display
        BLANK()
    ),
    [Turnover]  // Replace with the measure you want to display for cost centres
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2024 05:58:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-10-14T05:58:31Z</dc:date>
    <item>
      <title>Filter a Matrix table by first row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4237587#M167622</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;my first post as a fairly new powerbi user, I hope I'm in the right section of the forum.&lt;/P&gt;&lt;P&gt;I have the following request:&lt;BR /&gt;I have a table with customer names. Also 3 further measures with turnover, contribution margin and the contribution margin in % of turnover (CM%) for each customer.&lt;BR /&gt;&lt;BR /&gt;I have stored the whole thing in a matrix table with the following arrangement:&lt;/P&gt;&lt;P&gt;Customer | Turnover | Contribution margin | CM %&lt;BR /&gt;Customer1 | 3425 | 342.5 | 10%&lt;BR /&gt;Customer2 | 2000 | 50 | 2.5%&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I would also like to filter the whole thing so that only the CM% that is below 5% is displayed. Everything works great so far.&lt;/P&gt;&lt;P&gt;Now the problem: I would like to expand the customer into its individual cost centres as an additional line under the respective customer, like this.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;- Customer 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13435251&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13526625&lt;BR /&gt;- Customer 2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11763727&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16467245&lt;/P&gt;&lt;P&gt;The cost centre is also a table and it also works with the corresponding measures for each cost centre.&lt;BR /&gt;&lt;BR /&gt;However, there is the case here that some customers are below the 5%, but the individual cost centres are above 5%. The filter mentioned above now filters out the cost centres so that the total figures change. However, I still only want to filter by customers and not by cost centres,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I have searched both here and on the internet for any information on how to filter only the first area, but unfortunately I have not been successful. I first tried another custom measure, like isinscope or calculate, but seem to be doing something wrong here. Is this even possible? Is it even possible?&lt;/P&gt;&lt;P&gt;I hope I have explained it clearly. Learning the DAX-Language is quite a task as a newcomer.&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;If I should provide more info or anything, please let me know!&lt;BR /&gt;Thank you in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 20:07:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4237587#M167622</guid>
      <dc:creator>PowerBIUser007</dc:creator>
      <dc:date>2024-10-10T20:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a Matrix table by first row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4239842#M167797</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="823450" data-lia-user-login="PowerBIUser007" class="lia-mention lia-mention-user"&gt;PowerBIUser007&lt;/a&gt;&amp;nbsp;-&amp;nbsp;You'll need to create a measure that calculates the CM% for the &lt;STRONG&gt;customer level&lt;/STRONG&gt; and use that measure to control your filter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;Customer CM% Filter = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[CM%], &lt;BR /&gt;ALLEXCEPT('YourTable', 'YourTable'[Customer])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your matrix visual, place Customer in the rows, then expand it to include Cost Center. Also, put your measures for Turnover, Contribution Margin, and CM% in the Values field.&lt;/P&gt;
&lt;P&gt;You can now apply a visual-level filter to your matrix visual to only display customers where the Customer CM% Filter is less than 5%.&lt;/P&gt;
&lt;P&gt;Go to the "Filters on this visual" pane in Power BI.&lt;BR /&gt;Drag your Customer CM% Filter measure to the filter area.&lt;BR /&gt;Set the filter to less than 5.&lt;/P&gt;
&lt;P&gt;in your CM% measure too&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CM% = &lt;BR /&gt;IF(&lt;BR /&gt;ISINSCOPE('YourTable'[CostCenter]),&lt;BR /&gt;DIVIDE([Contribution Margin], [Turnover]),&lt;BR /&gt;[Customer CM% Filter] -- Use the customer level measure here&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;This way, when you're at the customer level, you'll see the filtered customer CM% (using Customer CM% Filter), but at the cost center level, you'll still see the individual cost center's CM%.&lt;/P&gt;
&lt;P&gt;I hope , by using the above approach,we can perform&amp;nbsp;the customer-level filtering without removing cost center details.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 03:40:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4239842#M167797</guid>
      <dc:creator>rajendraongole1</dc:creator>
      <dc:date>2024-10-13T03:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a Matrix table by first row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4240650#M167875</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="823450" data-lia-user-login="PowerBIUser007" class="lia-mention lia-mention-user"&gt;PowerBIUser007&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't know much about your data model, but you can try the following expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CustomerCMFilter = 
IF (
    HASONEVALUE('Customer'[CustomerName]),
    IF (
        [CM%] &amp;lt; 0.05,
        1,
        0
    ),
    1
)

DisplayMeasure = 
IF (
    ISINSCOPE('Customer'[CustomerName]),
    IF (
        [CustomerCMFilter] = 1,
        [Turnover],  // Replace with the measure you want to display
        BLANK()
    ),
    [Turnover]  // Replace with the measure you want to display for cost centres
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 05:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-a-Matrix-table-by-first-row/m-p/4240650#M167875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-14T05:58:31Z</dc:date>
    </item>
  </channel>
</rss>

