<?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: CALCULATE TOP 20% (Tableau Fixed Percentile to DAX) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831550#M184551</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;, thank you very much for your reply!&lt;BR /&gt;&lt;BR /&gt;And how could I be sure that this is also dynamically changing based on the year/month selected? The fact table also has a date column with the format YYYY-MM-01&lt;BR /&gt;&lt;BR /&gt;To make it more simple, we can also ignore the segment and ABC column, assuming the fact table has the following columns: date, creditor, spend&lt;/P&gt;</description>
    <pubDate>Sun, 21 Sep 2025 22:33:28 GMT</pubDate>
    <dc:creator>icos</dc:creator>
    <dc:date>2025-09-21T22:33:28Z</dc:date>
    <item>
      <title>CALCULATE TOP 20% (Tableau Fixed Percentile to DAX)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831511#M184548</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I've been trying to do this calculation and also see on previous posts, but couldn't find a solution that fits my needs.&lt;BR /&gt;&lt;BR /&gt;I have on one Tableau file a Tableau LOD (Level of Detail) expression that is calculating whether each creditor's total spend is in the top 20% (80th percentile or above), and I would like to be able to replicate it on Power BI:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{FIXED [Creditors / Vendors], [ABC Class], [Segment Name] : SUM([Spend])} &amp;gt;= FIXED : PERCENTILE ( { FIXED [Creditors / Vendors], [ABC Class], [Segment Name] : SUM([Spend]), 80%) }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Output exepected on Power BI:&lt;/STRONG&gt;&lt;BR /&gt;card visual with total spend value for Top 20% creditors&lt;BR /&gt;card visual with number of creditors that are on the Top 20%&lt;BR /&gt;&lt;BR /&gt;The original dataset has 147,681 rows, and so when I am trying to apply some kind of running totals it returns "query resources exceeded" a lot of times.&lt;BR /&gt;&lt;BR /&gt;I am sending a&amp;nbsp;&lt;A href="https://www.dropbox.com/scl/fi/986c6wn9g8g90j4qqgwb5/Power-BI-Community.pbix?rlkey=ruqv0ra1govw3njvqir9oqxnz&amp;amp;st=01s376q2&amp;amp;dl=0" target="_blank" rel="nofollow noopener noreferrer"&gt;&lt;STRONG&gt;pbix file&lt;/STRONG&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;with the same structure as my real data, I've put the columns even more simple than in tableau, having only one date column, the creditor reference, and the spend.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Would really appreciate your help on this!! Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Sep 2025 19:05:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831511#M184548</guid>
      <dc:creator>icos</dc:creator>
      <dc:date>2025-09-21T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: CALCULATE TOP 20% (Tableau Fixed Percentile to DAX)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831516#M184549</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="582013" data-lia-user-login="icos" class="lia-mention lia-mention-user"&gt;icos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="93" data-end="197"&gt;Assume your table is Facts with columns:&lt;BR /&gt;Facts[Creditor], Facts[ABC Class], Facts[Segment], Facts[Spend]&lt;/P&gt;
&lt;OL data-start="199" data-end="1094"&gt;
&lt;LI data-start="199" data-end="247"&gt;
&lt;P data-start="202" data-end="247"&gt;Base measure&lt;BR /&gt;Total Spend :=&lt;BR /&gt;SUM(Facts[Spend])&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="249" data-end="586"&gt;
&lt;P data-start="252" data-end="586"&gt;Vendor totals (virtual table by current group)&lt;BR /&gt;_vtVendorTotals :=&lt;BR /&gt;VAR T =&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(Facts),&lt;BR /&gt;Facts[ABC Class] IN VALUES(Facts[ABC Class]) &amp;amp;&amp;amp;&lt;BR /&gt;Facts[Segment] IN VALUES(Facts[Segment])&lt;BR /&gt;),&lt;BR /&gt;Facts[Creditor],&lt;BR /&gt;"Tot", CALCULATE([Total Spend])&lt;BR /&gt;)&lt;BR /&gt;RETURN T&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="588" data-end="729"&gt;
&lt;P data-start="591" data-end="729"&gt;80th percentile threshold (per ABC Class × Segment)&lt;BR /&gt;Top20 Threshold :=&lt;BR /&gt;VAR T = [_vtVendorTotals]&lt;BR /&gt;RETURN&lt;BR /&gt;PERCENTILEX.INC(T, [Tot], 0.8)&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="731" data-end="929"&gt;
&lt;P data-start="734" data-end="929"&gt;Card: total spend of top-20% creditors (by current ABC Class × Segment filter)&lt;BR /&gt;Top20 Spend :=&lt;BR /&gt;VAR T = [_vtVendorTotals]&lt;BR /&gt;VAR Th = [Top20 Threshold]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX( FILTER(T, [Tot] &amp;gt;= Th), [Tot] )&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="931" data-end="1094"&gt;
&lt;P data-start="934" data-end="1094"&gt;Card: number of creditors in top-20%&lt;BR /&gt;Top20 Creditor Count :=&lt;BR /&gt;VAR T = [_vtVendorTotals]&lt;BR /&gt;VAR Th = [Top20 Threshold]&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS( FILTER(T, [Tot] &amp;gt;= Th) )&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P data-start="1096" data-end="1337"&gt;Notes&lt;BR /&gt;• Slice by ABC Class and Segment (or keep them in the visual/page filter) so the percentile is computed within each group.&lt;BR /&gt;• These are measures (no calculated tables/columns), so they should be memory-friendly even on large row counts.&lt;/P&gt;
&lt;P data-start="1096" data-end="1337"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;STRONG&gt; helps&lt;/STRONG&gt;, please consider &lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;|&lt;A href="https://twitter.com/VahidDMcom" target="_blank" rel="noopener noreferrer"&gt;Twitter&lt;/A&gt;|&lt;A href="https://www.vahiddm.com/" target="_blank" rel="noopener noreferrer"&gt;Blog&amp;nbsp;&lt;/A&gt;|&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;YouTube&lt;/A&gt;&lt;A href="https://www.youtube.com/@databis" target="_blank" rel="noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Sep 2025 20:18:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831516#M184549</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2025-09-21T20:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: CALCULATE TOP 20% (Tableau Fixed Percentile to DAX)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831550#M184551</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;, thank you very much for your reply!&lt;BR /&gt;&lt;BR /&gt;And how could I be sure that this is also dynamically changing based on the year/month selected? The fact table also has a date column with the format YYYY-MM-01&lt;BR /&gt;&lt;BR /&gt;To make it more simple, we can also ignore the segment and ABC column, assuming the fact table has the following columns: date, creditor, spend&lt;/P&gt;</description>
      <pubDate>Sun, 21 Sep 2025 22:33:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4831550#M184551</guid>
      <dc:creator>icos</dc:creator>
      <dc:date>2025-09-21T22:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: CALCULATE TOP 20% (Tableau Fixed Percentile to DAX)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4832309#M184579</link>
      <description>&lt;P&gt;Thankyou,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;, for your response.&lt;BR /&gt;&lt;BR /&gt;Hi icos,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We appreciate your question on the Microsoft Fabric Community Forum.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Based on my understanding of the scenario, please find attached a screenshot and a sample PBIX file that may assist in resolving the issue:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;We hope the information provided helps to resolve the issue. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2025 12:10:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/CALCULATE-TOP-20-Tableau-Fixed-Percentile-to-DAX/m-p/4832309#M184579</guid>
      <dc:creator>v-pnaroju-msft</dc:creator>
      <dc:date>2025-09-22T12:10:43Z</dc:date>
    </item>
  </channel>
</rss>

