<?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 TOP N without duplicate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1035071#M13751</link>
    <description>Wow, Thank you a lot for the quick respose. I will try it tomorrow in the morning and will let you know if I could fix it. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Sun, 19 Apr 2020 23:26:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-04-19T23:26:39Z</dc:date>
    <item>
      <title>Filter TOP N without duplicate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1034958#M13743</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a beginner in Power bi and I am desperate with filtering the TOP N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Table with three columns: Country, Asset Name, Expenses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when I set the Filter Top N (5) in Asset Name and filter by value "Expenses" It shows me 7 not 5 Assets, because the Asset "Festival" appears 3 times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe someone could help me with my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in Advance!&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 20:33:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1034958#M13743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-19T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter TOP N without duplicate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1034988#M13749</link>
      <description>&lt;P&gt;Add the country code to the Asset Name to disambiguate. For instance, Festivals (PT), and use this instead of just Asset Name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or create a measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Top5 Assets Filter] =
var __top5CountryAsset =
	CALCULATE(
		TOPN(5,
			SUMMARIZE(
				FactTable,
				Countries[Country],
				Assets[Asset Name]
			),
			[Expense], // must be a measure
			DESC
		),
		ALL( Countries ),
		ALL( Assets )
	)
var __currentCountry = SELECTEDVALUE( Countries[Country] )
var __currentAsset = SELECTEDVALUE( Assets[Asset Name] )
var __setOne =
	__top5CountryAsset in {
		(__currentCountry, __currentAsset)
	}
	&amp;amp;&amp;amp;
	{
		(__currentCountry, __currentAsset)
	} in __top5CountryAsset
return
	1 * __setOne&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and use it as a filter for the visual setting it to "is 1."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 21:39:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1034988#M13749</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-19T21:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filter TOP N without duplicate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1035071#M13751</link>
      <description>Wow, Thank you a lot for the quick respose. I will try it tomorrow in the morning and will let you know if I could fix it. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 19 Apr 2020 23:26:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1035071#M13751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-19T23:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filter TOP N without duplicate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1037449#M13841</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you again for your help yesterday evenig. The problem is, that I have several Assetnames called Festival in a country, so it would not help a lot when I add the Country code. If I will change to Top 10, then I will have the same problem again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I am totally a beginner in writting measures or programming. I tried to copy the measure you wrote, but I dont know how to adjust the Table names with my data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This Is my Data table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats how I tried to adjust it, but without results &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you could explain me shortly, what I have to do? And what is meant by a FactTable, should I leave it or change the Name in the Measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you and best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Albert&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:35:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1037449#M13841</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-20T19:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filter TOP N without duplicate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1037526#M13844</link>
      <description>If you are a total beginner... then you should first learn about the subject a bit and then try your hand at it. Here's something to get you started:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=_quTwyvDfG0" target="_blank"&gt;https://www.youtube.com/watch?v=_quTwyvDfG0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=78d6mwR8GtA" target="_blank"&gt;https://www.youtube.com/watch?v=78d6mwR8GtA&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/" target="_blank"&gt;https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/basics-of-time-intelligence-in-dax-for-power-bi-year-to-date-quarter-to-date-month-to-date" target="_blank"&gt;https://radacad.com/basics-of-time-intelligence-in-dax-for-power-bi-year-to-date-quarter-to-date-month-to-date&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You should never use a single table to hold all of your data unless... you want to create a monster you won't be able to control and unless you want to produce wrong numbers in no time. Also, if the model is incorrect, DAX will be extremely hard to write, will be complex and inefficient. So, please do yourself a favour and learn first how to build correct and simple models. Start with the above.&lt;BR /&gt;&lt;BR /&gt;DAX and PBI are not Excel and DAX requires a lot of learning to use it with confidence and correctly. Please, therefore, first learn the foundations and then start building models. Not the other way round. That's the best advice I can give you.&lt;BR /&gt;&lt;BR /&gt;The best site about DAX is &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt;. But there are others that do just as well. For instance, Matt Allington's. Have a look at this&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=eOJkOWMYSkk" target="_blank"&gt;https://www.youtube.com/watch?v=eOJkOWMYSkk&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and you can then research further yourself. There are many good materials about DAX and PBI on YT. Please use them to your advantage.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 20 Apr 2020 20:25:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-TOP-N-without-duplicate/m-p/1037526#M13844</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-20T20:25:31Z</dc:date>
    </item>
  </channel>
</rss>

