<?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: Filter context issue trying to visualize top ranked items in different categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133903#M16882</link>
    <description>&lt;P&gt;For Rank Refer these links&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2020 18:03:20 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-06-01T18:03:20Z</dc:date>
    <item>
      <title>Filter context issue trying to visualize top ranked items in different categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133636#M16870</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working with a dataset containing the subcategories Area, Product and Article for different Shops, and the amount of sales by Article. For each shop the ranking of Area is determined according to the total sales. Then for the Area ranked 1 the ranking of Products is found, and for the Product ranked 1 the ranking of the Articles is in turn determined.&lt;/P&gt;&lt;P&gt;So, for each Shop, I have the top Article within the top Product subcategory within the top Area of that Shop. Three shops, three top articles.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now I need to compare the sales of each of these three top articles in all the shops in a bar chart, switching the top Article by means of the Shop slicer already existent in the canvas: selecting Shop A the chart must show the sales of the top Article in Shop A in all three shops, and so on (shops in x-axis).&lt;/P&gt;&lt;P&gt;My problem is with the Shop filter. In the measure I need to get the sales in all shops but at the same time filtering by shop in order to set the article. I tested this measure but it doesn't work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NSalesBarChart = 
VAR
Rank1Article = CALCULATE(
SELECTEDVALUE(Sales[Article]), 
FILTER(VALUES(Sales[Article]), [Rank Article] = 1) 
)
RETURN

CALCULATE(MIN(Sales[ArticleNSales]), Sales[Article] = Rank1Article)&lt;/LI-CODE&gt;&lt;P&gt;Ideas? Find below the link to the pbix file. Thanks!&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1eLWKETSCFSU0inPrFfVpyi2dI-DZ7tzj/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1eLWKETSCFSU0inPrFfVpyi2dI-DZ7tzj/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 15:33:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133636#M16870</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-06-01T15:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context issue trying to visualize top ranked items in different categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133903#M16882</link>
      <description>&lt;P&gt;For Rank Refer these links&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 18:03:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133903#M16882</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-06-01T18:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context issue trying to visualize top ranked items in different categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133988#M16884</link>
      <description>&lt;P&gt;It's ugly, but some might find its simplicity beautiful. Just duplicate your sales table and display a separate chart from the second table yet filtered on your number one article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's probably easy to understand for an outsider when they need to work with your file vs. trying to understand the DAX code required for the fancy solution. Unless of course performance prohibits this solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this work for you? If so, please mark as solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:14:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1133988#M16884</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-01T19:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context issue trying to visualize top ranked items in different categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1138645#M17011</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Solved. I modified the measure as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NSalesBarChart = 
VAR
CurrentShop = CALCULATE(SELECTEDVALUE(TabellaShop[Shop]))
VAR
Rank1Article = CALCULATE(
        SELECTEDVALUE(Sales[Article]),    
        FILTER(VALUES(Sales[Article]), [Rank Article] = 1) 
)
RETURN

CALCULATE(MIN(Sales[ArticleNSales]), FILTER(ALL(Sales), Sales[Article] = Rank1Article &amp;amp;&amp;amp; Sales[Shop] = currentShop))&lt;/LI-CODE&gt;&lt;P&gt;I created an auxiliary table with the names of the shops (TabellaShop) and used these values on the x-axis of the bar chart. I filter the shop using this as a way to ignore the Shop filter context, applied rather to the selection of the top ranked Article to visualize.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ariel&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 10:45:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1138645#M17011</guid>
      <dc:creator>arielcedola</dc:creator>
      <dc:date>2020-06-03T10:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context issue trying to visualize top ranked items in different categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1138781#M17013</link>
      <description>&lt;P&gt;Nice! Thats a more elegant way to implement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 11:37:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context-issue-trying-to-visualize-top-ranked-items-in/m-p/1138781#M17013</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-03T11:37:22Z</dc:date>
    </item>
  </channel>
</rss>

