<?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: Measure Request: Value is within TopN, True or False in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2798719#M88009</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316579" data-lia-user-login="nckpedersen" class="lia-mention lia-mention-user"&gt;nckpedersen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(&lt;STRONG&gt;see attachment&lt;/STRONG&gt;) for you, please check whether that is what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create two&amp;nbsp;&lt;STRONG&gt;measures&lt;/STRONG&gt; as below to judge if the account is&amp;nbsp;&lt;SPAN&gt;Top 2 accounts&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank = RANKX ( ALLSELECTED ( 'Accounts' ), CALCULATE ( SUM ( 'Accounts'[Sales] ) ) )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Flag = 
VAR _tab =
    CALCULATETABLE (
        VALUES ( 'Accounts'[Account] ),
        FILTER ( 'Accounts', [Rank] &amp;lt;= 2 )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Contacts'[Account] ) IN _tab, 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a table visual and apply the visual-level filter with the condition(&lt;EM&gt;&lt;STRONG&gt;Flag is 1&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;sensitive&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2022 06:39:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-27T06:39:40Z</dc:date>
    <item>
      <title>Measure Request: Value is within TopN, True or False</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2797994#M87970</link>
      <description>&lt;P&gt;I have two tables, Contacts and Accounts. I want to apply a filter on Contacts according to whether or not the Account it belongs to is within the Top 2 Accounts by Sales. So given the table below, I'd want to only see Bob and Alice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize I can use the filters option but need the formula for a more complex situation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Contacts&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;ABC Corp&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;XYZ Inc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;Test, LLC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Alice&lt;/TD&gt;&lt;TD&gt;Example Inc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Accounts&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;$100&lt;/TD&gt;&lt;TD&gt;ABC Corp&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;$1000&lt;/TD&gt;&lt;TD&gt;XYZ Inc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;$5000&lt;/TD&gt;&lt;TD&gt;Test, LLC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;$10,000&lt;/TD&gt;&lt;TD&gt;Example Inc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 26 Sep 2022 23:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2797994#M87970</guid>
      <dc:creator>nckpedersen</dc:creator>
      <dc:date>2022-09-26T23:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Request: Value is within TopN, True or False</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2798199#M87981</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316579" data-lia-user-login="nckpedersen" class="lia-mention lia-mention-user"&gt;nckpedersen&lt;/a&gt; , My advice would be create TOP2 measure and use in Visual &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TOPN: &lt;A href="https://youtu.be/QIVEFp-QiOk" target="_blank"&gt;https://youtu.be/QIVEFp-QiOk&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise first create a rank in Accounts (All new columns below )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rank = ranxk(Accounts, [Sales],,desc, dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then copy that to table Contacts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rank contact = Maxx(filter(Accounts, Accounts[Account] = Contacts [Account] &amp;amp;&amp;amp; Accounts[Rank]&amp;lt;=2), Accounts[Rank])&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 02:04:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2798199#M87981</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-09-27T02:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Request: Value is within TopN, True or False</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2798719#M88009</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="316579" data-lia-user-login="nckpedersen" class="lia-mention lia-mention-user"&gt;nckpedersen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created a sample pbix file(&lt;STRONG&gt;see attachment&lt;/STRONG&gt;) for you, please check whether that is what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create two&amp;nbsp;&lt;STRONG&gt;measures&lt;/STRONG&gt; as below to judge if the account is&amp;nbsp;&lt;SPAN&gt;Top 2 accounts&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank = RANKX ( ALLSELECTED ( 'Accounts' ), CALCULATE ( SUM ( 'Accounts'[Sales] ) ) )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Flag = 
VAR _tab =
    CALCULATETABLE (
        VALUES ( 'Accounts'[Account] ),
        FILTER ( 'Accounts', [Rank] &amp;lt;= 2 )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Contacts'[Account] ) IN _tab, 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a table visual and apply the visual-level filter with the condition(&lt;EM&gt;&lt;STRONG&gt;Flag is 1&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;sensitive&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 06:39:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2798719#M88009</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-27T06:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Request: Value is within TopN, True or False</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2809384#M88818</link>
      <description>&lt;P&gt;This is wonderful, thank you! I feel like you just opened an entirely new area of Power BI for me!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:36:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Request-Value-is-within-TopN-True-or-False/m-p/2809384#M88818</guid>
      <dc:creator>nckpedersen</dc:creator>
      <dc:date>2022-09-30T21:36:21Z</dc:date>
    </item>
  </channel>
</rss>

