<?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: Auto-Filter and Auto-Sort Matrix by Selected Parameter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Auto-Filter-and-Auto-Sort-Matrix-by-Selected-Parameter/m-p/3806695#M148842</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="716826" data-lia-user-login="jfishbac" class="lia-mention lia-mention-user"&gt;jfishbac&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, try to enter the following rank measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can view the following documents to learn more about field parameters.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters#create-a-field-parameter" target="_blank" rel="noopener"&gt;Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/rankx-function-dax" target="_blank" rel="noopener"&gt;RANKX function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above ones can’t help you get it working, c&lt;SPAN&gt;ould you please provide &lt;/SPAN&gt;more raw data(exclude sensitive data) with Text format &lt;SPAN&gt;to make a deep troubleshooting? &lt;/SPAN&gt;It would be helpful to find out the solution.&lt;/P&gt;
&lt;P&gt;You can refer the following links to share the required information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 06:44:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-03T06:44:30Z</dc:date>
    <item>
      <title>Auto-Filter and Auto-Sort Matrix by Selected Parameter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Auto-Filter-and-Auto-Sort-Matrix-by-Selected-Parameter/m-p/3805904#M148816</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a panel of 3 buttons using a Field Parameter called "FinancialFocus".&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This button selection returns the desired values in the following Matrix. If ORDERS is chosen, then ORDERS detail for each project is shown. If REVENUE is selected, then REVENUE figures are presented. This all seems to work as expected.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following "Top N" (i.e. top 75) filter is applied to this matrix:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following fields are used to generate the Matrix:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"FinancialFocus" is a field parameter with the following definitions.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where, for example, "measure_REV_USD_d" is defined as follows, which essentially returns the year-to-date Revenue Actuals, Forecast, and Budget for each Project Description in the matrix above. "measure_ORDER_USD_d" and "measure_GP_USD_d" behave similarly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;measure_REV_USD_d = CALCULATE(SUMX('OSGM Data_LC','OSGM Data_LC'[REV_USD_d]),AND(LEFT('OSGM Data_LC'[Period],1)="M",'OSGM Data_LC'[Period]&amp;lt;='OSGM Data_LC'[ctrl_ActThruPeriod]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;What I'm trying to achieve is the ability to "auto-sort" and "auto-filter" the matrix based on the button selection.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If ORDERS is selected, then &lt;STRONG&gt;FILTER&lt;/STRONG&gt; the Matrix to show the Top 75 projects based on "Sum of ORDER_USD_d"&lt;UL&gt;&lt;LI&gt;Then...&lt;STRONG&gt;SORT&amp;nbsp;&lt;/STRONG&gt;the Matrix in descending order base on the ORDER Values shown in the Matrix&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If REVENUE is selected, then &lt;STRONG&gt;FILTER&lt;/STRONG&gt; the Matrix to show the Top 75 projects based on "Sum of REV_USD_d"&lt;UL&gt;&lt;LI&gt;&amp;nbsp;Then...&lt;STRONG&gt;SORT&amp;nbsp;&lt;/STRONG&gt;the Matrix in descending order base on the REVENUE Values shown in the Matrix&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If GROSS PROFIT is selected, then &lt;STRONG&gt;FILTER&lt;/STRONG&gt; the matrix to show the Top 75 projects based on "Sum of GP_USD_d"&lt;UL&gt;&lt;LI&gt;&amp;nbsp;Then...&lt;STRONG&gt;SORT&amp;nbsp;&lt;/STRONG&gt;the Matrix in descending order base on the GROSS PROFIT Values shown in the Matrix&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I attempted to use &lt;STRONG&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/Sorting-on-Parameter-fields-measures/m-p/2853710" target="_self"&gt;this solution&lt;/A&gt;&lt;/STRONG&gt; from&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365631" data-lia-user-login="rpinxt" class="lia-mention lia-mention-user"&gt;rpinxt&lt;/a&gt;, but the result I get is a bunch of 1's and other odd numbers. I feel his/her solution is along the lines of what I'm looking for - so I'm sure missing something. Here is my attempt at implementing&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365631" data-lia-user-login="rpinxt" class="lia-mention lia-mention-user"&gt;rpinxt&lt;/a&gt;'s solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;Added sort column to the Field Parameter table&lt;OL&gt;&lt;LI&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Created a Measure called "FinancialFocus_RANK"&lt;OL&gt;&lt;LI&gt;&lt;img /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;NOTE: I believe this is where I'm failing - I don't think I'm using RANKX and ALLSELECTED properly.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Added "FinancialFocus_RANK" to the values well of the Matrix&lt;OL&gt;&lt;LI&gt;&lt;img /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;The result is mostly "1's" and a couple instances of "2966".&lt;OL&gt;&lt;LI&gt;&lt;img /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Obviously not the result I'd want. Instead I'd like to see the first row of the matrix be a high value, and then incrementally get smaller as you scan through the matrix. Likewise, I'd like these rankings to change dynamically depending on the button selected (ORDERS, REVENUE, GROSS PROFIT), and I'd like the Top N Filter to respond in kind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully someone can point me in the right direction - thanks in advance!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 20:47:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Auto-Filter-and-Auto-Sort-Matrix-by-Selected-Parameter/m-p/3805904#M148816</guid>
      <dc:creator>jfishbac</dc:creator>
      <dc:date>2024-04-02T20:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-Filter and Auto-Sort Matrix by Selected Parameter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Auto-Filter-and-Auto-Sort-Matrix-by-Selected-Parameter/m-p/3806695#M148842</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="716826" data-lia-user-login="jfishbac" class="lia-mention lia-mention-user"&gt;jfishbac&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, try to enter the following rank measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
= Rankx(all(OSGM Data_LC[ProjectDesc]), [measure],,DESC)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can view the following documents to learn more about field parameters.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters#create-a-field-parameter" target="_blank" rel="noopener"&gt;Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/rankx-function-dax" target="_blank" rel="noopener"&gt;RANKX function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above ones can’t help you get it working, c&lt;SPAN&gt;ould you please provide &lt;/SPAN&gt;more raw data(exclude sensitive data) with Text format &lt;SPAN&gt;to make a deep troubleshooting? &lt;/SPAN&gt;It would be helpful to find out the solution.&lt;/P&gt;
&lt;P&gt;You can refer the following links to share the required information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 06:44:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Auto-Filter-and-Auto-Sort-Matrix-by-Selected-Parameter/m-p/3806695#M148842</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T06:44:30Z</dc:date>
    </item>
  </channel>
</rss>

