<?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: Get the value for sub category by certain % in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721087#M180815</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;One approach to this is by creating a filter flag measure. To create the measure, try using the following DAX:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilterFlag =
VAR TotalSales = CALCULATE(SUM(SalesData[Sales]), ALL(SalesData))
VAR MainCategorySales =
    CALCULATE(
        SUM(SalesData[Sales]),
        ALLEXCEPT(SalesData, SalesData[MainCategory])
    )
VAR Weightage = DIVIDE(MainCategorySales, TotalSales)
RETURN
IF(Weightage &amp;gt;= 0.3, 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then add this measure to your filter pane and set it to where the FilterFlag is equal to 1.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will filter your visual to all&amp;nbsp;&lt;SPAN&gt;sales of sub category where the total weightage is more or equal to 30%.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Samson&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 08:34:41 GMT</pubDate>
    <dc:creator>SamsonTruong</dc:creator>
    <dc:date>2025-06-05T08:34:41Z</dc:date>
    <item>
      <title>Get the value for sub category by certain %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721051#M180814</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I would like to get the total sales of subcategory where the main category is more than certain %&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to show all the sales of sub category where the total weightage is more or equal to 30%.&amp;nbsp;&lt;BR /&gt;for example, the main category that is more than 30% are "Clothes 2" and "Car"&lt;BR /&gt;and now, I want to get all details of item in sub category which are under "Clothes 2" and "Car".&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this by creating the measure in power bi ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 08:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721051#M180814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-05T08:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get the value for sub category by certain %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721087#M180815</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;One approach to this is by creating a filter flag measure. To create the measure, try using the following DAX:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilterFlag =
VAR TotalSales = CALCULATE(SUM(SalesData[Sales]), ALL(SalesData))
VAR MainCategorySales =
    CALCULATE(
        SUM(SalesData[Sales]),
        ALLEXCEPT(SalesData, SalesData[MainCategory])
    )
VAR Weightage = DIVIDE(MainCategorySales, TotalSales)
RETURN
IF(Weightage &amp;gt;= 0.3, 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Then add this measure to your filter pane and set it to where the FilterFlag is equal to 1.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will filter your visual to all&amp;nbsp;&lt;SPAN&gt;sales of sub category where the total weightage is more or equal to 30%.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Samson&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 08:34:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721087#M180815</guid>
      <dc:creator>SamsonTruong</dc:creator>
      <dc:date>2025-06-05T08:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get the value for sub category by certain %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721140#M180820</link>
      <description>&lt;P&gt;If you already have measures for [Sales] and [Weightage] you can create a new measure like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales for category above 30 =
VAR MainCategories =
    FILTER ( ALL ( 'Table'[Main Category] ), [Weightage] &amp;gt;= 0.3 )
VAR Result =
    CALCULATE ( [Sales], KEEPFILTERS ( MainCategories ) )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Jun 2025 09:20:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-the-value-for-sub-category-by-certain/m-p/4721140#M180820</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-06-05T09:20:37Z</dc:date>
    </item>
  </channel>
</rss>

