<?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: How to combine TOP 6 &amp;amp; BOTTOM 2 results from another DAX measure into new measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883473#M93410</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443481" data-lia-user-login="Ilias_pal" class="lia-mention lia-mention-user"&gt;Ilias_pal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What is the name of the prduct name column that is used in the chart and from which table?&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 16:49:46 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-11-03T16:49:46Z</dc:date>
    <item>
      <title>How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2775208#M86613</link>
      <description>&lt;P&gt;I have linked SAP with PowerBI two different tables, one containing current year sales per product &amp;amp; country and the other containing previous year sales per product &amp;amp; country.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a DAX measure to calculate "vs. Prior Year" sales and now I have been asked to create a chart that will show the top 6 and bottom 2 products, so each country lead can get this info.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to filter in the chart of "vs. Prior Year" both Top 6 and Bottom 2 filter, but it`s not allowing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, i am trying to use a new DAX measure that will combine Top 6 &amp;amp; bottom 2 "vs. Prior Year", however TOPN measure requires a table in the 2nd position and it doesn`t accept another DAX measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TOPN(&amp;lt;N_Value&amp;gt;, &amp;lt;Table&amp;gt;, &amp;lt;OrderBy_Expression&amp;gt;, [&amp;lt;Order&amp;gt;[, &amp;lt;OrderBy_Expression&amp;gt;, [&amp;lt;Order&amp;gt;]]…])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how I can solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 16:43:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2775208#M86613</guid>
      <dc:creator>Ilias_pal</dc:creator>
      <dc:date>2022-09-17T16:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2775242#M86615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443481" data-lia-user-login="Ilias_pal" class="lia-mention lia-mention-user"&gt;Ilias_pal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i don't have enough information to generate dax code that serves your requirement but I can give you an idea on how to proceed.&amp;nbsp;&lt;BR /&gt;So my understanding is that your chart will slice the [Sales Amount] measure by product leaving a country slicer on the side. The way to move forward is create a filter measure and place it in tge filter pane of the visual.&amp;nbsp;&lt;BR /&gt;The measure shall be based on a virtual table that UNION the TOPN - 6 - DESC and TOPN - 2 - ASC of ALLSELECTED products then checks IF the CrrentProduct is within these products and if so returns a fixed value otherwise returns blank.&amp;nbsp;&lt;BR /&gt;This way you can filter the chart by selecting "Is not blank" for this filter measure.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 17:04:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2775242#M86615</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-09-17T17:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883359#M93405</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the first DAX measure, I have created which calculates the "&lt;EM&gt;vs. PY Net Sales&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The Current Year Net Sales are sourced from the table "&lt;SPAN&gt;&lt;EM&gt;CV_BPC_BRIDGES_R4_FC&lt;/EM&gt;", while the Prior Year Net Sales were already calculated in the "&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PY Actual Net Sales' that is included in the measure and are sourced from the table "&lt;/SPAN&gt;&lt;SPAN&gt;&lt;EM&gt;CV_BPC_BRIDGES_R4_ACT&lt;/EM&gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you correctly mentioned, the country selection will be through a slicer, however since the two tables&amp;nbsp;"&lt;SPAN&gt;&lt;EM&gt;CV_BPC_BRIDGES_R4_FC&lt;/EM&gt;" &amp;amp;&amp;nbsp;&lt;EM&gt;CV_BPC_BRIDGES_R4_ACT&lt;/EM&gt;" do not contain similar rows, it`s not possible to use UNION measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any other idea how I can create a measure which will show me dynamically the top 6 and bottom 2 products "vs. PY Net Sales" measure so I can visualize it like this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Nov 2022 15:52:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883359#M93405</guid>
      <dc:creator>Ilias_pal</dc:creator>
      <dc:date>2022-11-03T15:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883473#M93410</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443481" data-lia-user-login="Ilias_pal" class="lia-mention lia-mention-user"&gt;Ilias_pal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;What is the name of the prduct name column that is used in the chart and from which table?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 16:49:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883473#M93410</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-03T16:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883491#M93413</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It`s called "Brand" from product list table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Product list table and the other two tables above, are linked with relationship 1 to many (1 brand can be many times in the other two tables)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 16:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2883491#M93413</guid>
      <dc:creator>Ilias_pal</dc:creator>
      <dc:date>2022-11-03T16:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2885387#M93507</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443481" data-lia-user-login="Ilias_pal" class="lia-mention lia-mention-user"&gt;Ilias_pal&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please place the following measure in the filter pane of the chart, select "is not blnak" and apply the filter.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;FilterMeasure =
VAR CurrentBrand =
    SELECTEDVALUE ( 'Product List'[Brand] )
VAR T1 =
    ADDCOLUMNS (
        ALLSELECTED ( 'Product List'[Brand] ),
        "@PYSales", [vs. PY Net Sales]
    )
VAR Top6 =
    TOPN ( 6, T1, [@PYSales] )
VAR Bottom2 =
    TOPN ( 2, T1, [@PYSales], ASC )
VAR T2 =
    SELECTCOLUMNS ( UNION ( Top6, Bottom2 ), "@Brand", [Brand] )
RETURN
    IF ( CurrentBrand IN T2, 1 )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 10:52:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2885387#M93507</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-04T10:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine TOP 6 &amp; BOTTOM 2 results from another DAX measure into new measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2885546#M93521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot! This DAX measure worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 12:18:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-combine-TOP-6-amp-BOTTOM-2-results-from-another-DAX/m-p/2885546#M93521</guid>
      <dc:creator>Ilias_pal</dc:creator>
      <dc:date>2022-11-04T12:18:16Z</dc:date>
    </item>
  </channel>
</rss>

