<?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: Return list of related country based on slicer selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4121184#M163622</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for responding.&lt;/P&gt;&lt;P&gt;This is working fine on smaller dataset. My data volumn is large. It is running out of memory and not returning results when I implemented same in my report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2024 16:49:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-27T16:49:06Z</dc:date>
    <item>
      <title>Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115467#M163357</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have model similar to the attached image. I need to write a measure that will show Agreegated Sale when Camp Name is selected using slicer. If user select Camp1,Camp2,Camp3 , it should return the associated Country Code (UK , US,IN) and retrun Sum(Sale) = 85 (10+20+35+20). There are several other slicers as well and few Dimension tables so the measure should consider all those as well while calculating the measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way where I can pass the associated Countries when any slicer is selected.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 09:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115467#M163357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-23T09:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115482#M163358</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- Rather than solve this through DAX (Complex), why dont you solve this through modelling (easy) and move Camp Name to DimLocation?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also move CountryName there, and then you have one dimension for two fact tables, and no complex DAX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This could easily be acheived by using MergeQueries in Power Query, here is some guidance,&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-query/merge-queries-overview" target="_blank"&gt;https://learn.microsoft.com/en-us/power-query/merge-queries-overview&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this works for you, please accept as the solution, it helps with visibility of the fix for others.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 09:54:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115482#M163358</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-08-23T09:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115496#M163360</link>
      <description>&lt;P&gt;CampName is an attribute of Fact table and can be repeated n number of times in Fact table with other key attributes. Moving to to Dim Location wont be possible. Also DimLocation is being used to slice and dice other fact table that are available in my model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This need to be handled thru DAX only.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 10:13:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115496#M163360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-23T10:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115504#M163361</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- Just because it's repeated many times, it does not mean it can't be moved to DimLocation. In fact, according to the principles of Dimensional Modelling and the best practice guidance of using a Star Schema with Power BI it SHOULD be moved to DimLocation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is done, it would be easier to exclude filtering from Camp Name in the DAX of measures from other fact tables (where it should not impact) than to move the filtering through to FactSale with your current solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you wish to handle this with DAX, that's your preference.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 10:20:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4115504#M163361</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-08-23T10:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4117958#M163480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I create four tables as you mentioned.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I think you can create a relationship between DimLocation table and FactSale table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then you can create a measure and here is the DAX code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Sales =
SUMX (
    FILTER (
        CROSSJOIN ( 'FactSale', 'DimLocation', 'FactEnquiry' ),
        'DimLocation'[CountryCode] = 'FactSale'[CountryCode]
            &amp;amp;&amp;amp; 'FactEnquiry'[Location#] = 'DimLocation'[Location#]
    ),
    [Sale]
)&lt;/LI-CODE&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 style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 06:44:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4117958#M163480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-26T06:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4121184#M163622</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for responding.&lt;/P&gt;&lt;P&gt;This is working fine on smaller dataset. My data volumn is large. It is running out of memory and not returning results when I implemented same in my report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 16:49:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4121184#M163622</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-27T16:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4121771#M163660</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;This method helps you in the direction in which your image is displayed.&lt;/P&gt;
&lt;P&gt;What I'm trying to say is that you can use the virtual table method to solve the problem you mentioned. In the DAX mentioned above, I used the CROSSJOIN method, and I thought you could try it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 02:59:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4121771#M163660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-28T02:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Return list of related country based on slicer selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4122532#M163681</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- This is exactly why I mentioned this should be solved via modelling and not DAX, which will be very inefficient and will lead to several bad modelling practices.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Bi-directional many-to-many relationship suggested by&amp;nbsp;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&amp;nbsp;is one of the biggest things you should avoid when working with large data volumes. It forces a full scan of both tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would still suggest you consider moving&amp;nbsp;Camp Name to DimLocation, if you do this with the correct join it will not dupicate the records in&amp;nbsp;DimLocation or you could just use&amp;nbsp;Table.Distinct once you have done so.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 10:09:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-list-of-related-country-based-on-slicer-selection/m-p/4122532#M163681</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-08-28T10:09:34Z</dc:date>
    </item>
  </channel>
</rss>

