<?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: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4864682#M185526</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To validate the logic, please share a sample dataset from the relevant tables in a usable format (not a screenshot), covering the issue completely and excluding any sensitive or unrelated information.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Nov 2025 07:25:15 GMT</pubDate>
    <dc:creator>v-aatheeque</dc:creator>
    <dc:date>2025-11-03T07:25:15Z</dc:date>
    <item>
      <title>Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4859897#M185381</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have two tables in my Power BI model:&lt;/P&gt;&lt;P&gt;1. Fact table – contains columns like Country, State, City, Pincode, Product Name, Category, etc.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2. Sales table – contains Sales Value and Product Name,date,net profit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a logic based on Sales Value bands:&lt;/P&gt;&lt;P&gt;Top 50% → Green&lt;/P&gt;&lt;P&gt;Next 20% → Yellow&lt;/P&gt;&lt;P&gt;Remaining 30% → Red&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here’s the requirement:&lt;BR /&gt;When I select any filter such as Country or Pincode, I only want to calculate the max sales value for that selected filter and not for all filters combined.&lt;/P&gt;&lt;P&gt;For example, if I select a specific Pincode, it filters 100 rows from my 10,000-row dataset. Among those 100 filtered rows, I want the top 50% to fall under Green, next 20% under Yellow, and the last 30% under Red dynamically based on filter selection.&lt;/P&gt;&lt;P&gt;I already tried writing a DAX measure, but it’s not giving the expected result. The calculation seems to ignore the filter context and applies across the entire dataset.&lt;/P&gt;&lt;P&gt;Could anyone please help me with the correct DAX logic to achieve this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 18:35:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4859897#M185381</guid>
      <dc:creator>Anandshah</dc:creator>
      <dc:date>2025-10-27T18:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4859923#M185383</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;It would be very helpful if you included sample data for this. Also, it sounds like perhaps you are missing a relationship between your two tables. Finally, your Sales table should be classified as your "fact" table since it contains numbers (metrics) while your other table sounds like a Product dimension table.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Oct 2025 19:12:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4859923#M185383</guid>
      <dc:creator>GeraldGEmerick</dc:creator>
      <dc:date>2025-10-27T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4860615#M185400</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sales Band =&lt;BR /&gt;VAR TotalSales = SUM(Sales[Sales Value])&lt;BR /&gt;VAR FilteredTable = ALLSELECTED(Sales)&lt;BR /&gt;VAR RankBySales = RANKX(FilteredTable, [Sales Value],, DESC, DENSE)&lt;BR /&gt;VAR TotalRows = COUNTROWS(FilteredTable)&lt;BR /&gt;VAR Percentile = RankBySales / TotalRows&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH(TRUE(),&lt;BR /&gt;Percentile &amp;lt;= 0.5, "Green",&lt;BR /&gt;Percentile &amp;lt;= 0.7, "Yellow",&lt;BR /&gt;"Red"&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This calculates percentiles within your current filter context, not the entire dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this answer helped, please click Kudos or mark as Solution.&lt;BR /&gt;-Kedar&lt;BR /&gt;LinkedIn: &lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank"&gt;https://www.linkedin.com/in/kedar-pande&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 13:01:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4860615#M185400</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2025-10-28T13:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4862067#M185456</link>
      <description>&lt;P&gt;No, this isn’t what I meant&amp;nbsp; I’ll explain it in detail here.&lt;/P&gt;&lt;P&gt;I have two tables in my Power BI model:&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":keycap_1:"&gt;1️⃣&lt;/span&gt; Fact Table – contains columns like Country, State, City, Pincode, Product Name, Category, etc.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":keycap_2:"&gt;2️⃣&lt;/span&gt; Sales Table – contains Sales Value, Store, Date, Net Profit, Store Size, and Employee Number.&lt;/P&gt;&lt;P&gt;My Requirement&lt;BR /&gt;I want to create a logic based on Sales Value bands as follows:&lt;/P&gt;&lt;P&gt;Top 50% → Green&lt;/P&gt;&lt;P&gt;Next 20% → Yellow&lt;/P&gt;&lt;P&gt;Remaining 30% → Red&lt;/P&gt;&lt;P&gt;The goal is to plot these bands dynamically based on the group or filters applied, and then superimpose the store-wise sales value over the bands.&lt;/P&gt;&lt;P&gt;For example:&lt;BR /&gt;If I have store-wise sales data across multiple states and I select California → Los Angeles, out of thousands of data points only 100 stores may appear.&lt;BR /&gt;Now, for those 100 stores:&lt;/P&gt;&lt;P&gt;The top 50% (highest sales) should form the Green band,&lt;/P&gt;&lt;P&gt;The next 20% should form the Yellow band,&lt;/P&gt;&lt;P&gt;The remaining 30% should form the Red band.&lt;/P&gt;&lt;P&gt;Based on these, I’ll have minimum and maximum values for each band (Green, Yellow, Red), which will define my band zones.&lt;/P&gt;&lt;P&gt;Additional Requirement&lt;BR /&gt;Once I get these bands using DAX, I also want to:&lt;/P&gt;&lt;P&gt;Superimpose the Sales Value of any particular store on top of these bands — so I can easily see where that store lies.&lt;/P&gt;&lt;P&gt;Ideally, I’d like to compare multiple stores at once (e.g., two or more) to visualize how they perform relative to the defined bands.&lt;/P&gt;&lt;P&gt;The important part is that the bands must be redefined dynamically based on the filters applied.&lt;BR /&gt;For example, if I apply an additional filter like “Employee Number &amp;gt; 3”, then the bands should recalculate automatically for the filtered dataset.&lt;/P&gt;&lt;P&gt;As of now, I can successfully plot the bands, but I’m unable to superimpose the Sales Value over them.&lt;BR /&gt;I’d really appreciate your support or guidance on how to achieve this part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2025 05:08:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4862067#M185456</guid>
      <dc:creator>Anandshah</dc:creator>
      <dc:date>2025-10-30T05:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4864682#M185526</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To validate the logic, please share a sample dataset from the relevant tables in a usable format (not a screenshot), covering the issue completely and excluding any sensitive or unrelated information.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2025 07:25:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4864682#M185526</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2025-11-03T07:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4867841#M185601</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To better reproduce and troubleshoot your scenario, we kindly request a small sample dataset/file. Please share it at your convenience, as this will help us provide a more accurate and tailored solution.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 09:29:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4867841#M185601</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2025-11-06T09:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with DAX logic for dynamic sales value banding (50% Green, 20% Yellow, 30% Red)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4871078#M185703</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1379837" data-lia-user-login="Anandshah" class="lia-mention lia-mention-user"&gt;Anandshah&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Have you had a chance to look through the responses shared earlier?&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;looking forward for your response ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 13:31:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-help-with-DAX-logic-for-dynamic-sales-value-banding-50/m-p/4871078#M185703</guid>
      <dc:creator>v-aatheeque</dc:creator>
      <dc:date>2025-11-10T13:31:57Z</dc:date>
    </item>
  </channel>
</rss>

