<?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: Combine multiple DISTINCT statements to get the MIN value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1961321#M42903</link>
    <description>&lt;P&gt;Thanks for your help! (Sry for the late reply, I was on vacation.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I testet your solution on a small "testing data set" and it worked completly fine, but not on my "real" data set I'm working on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain why you've selected the column 'Contract ID' for the REMOVEFILTERS function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jul 2021 07:08:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-16T07:08:34Z</dc:date>
    <item>
      <title>Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1921763#M41658</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm new to the world of Power BI and I need your help.&lt;/P&gt;&lt;P&gt;My goal is to find the lowest value ('Price') filtered by a combination of two columns ('Product_ID' and 'Month Number'). Take this table as an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Total Sales Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&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TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;That is what I want to achive:&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Contract_ID&lt;/TD&gt;&lt;TD&gt;Product_ID&lt;/TD&gt;&lt;TD&gt;Month_Number&lt;/TD&gt;&lt;TD&gt;Price&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Best_Price per&lt;BR /&gt;Product and Month&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2,34&lt;/TD&gt;&lt;TD&gt;2,22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2,22&lt;/TD&gt;&lt;TD&gt;2,22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2,45&lt;/TD&gt;&lt;TD&gt;2,22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2,19&lt;/TD&gt;&lt;TD&gt;2,19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2,37&lt;/TD&gt;&lt;TD&gt;2,19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06&lt;/TD&gt;&lt;TD&gt;2002&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5,69&lt;/TD&gt;&lt;TD&gt;5,14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07&lt;/TD&gt;&lt;TD&gt;2002&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5,14&lt;/TD&gt;&lt;TD&gt;5,14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;And so on&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I had tried, but it didn't work:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Best_Price per Product and Month =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MINX(Total_Sales, Total_Sales[Price]),&lt;BR /&gt;DISTINCT(Total_Sales[Product_ID]),&lt;BR /&gt;DISTINCT(Total_Sales[Month_Number]&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any sugesstions / ideas how to solve that issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would help me a lot! Thanks in advance&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Jun 2021 07:30:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1921763#M41658</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-25T07:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1923142#M41693</link>
      <description>&lt;P&gt;See if this works for you:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Best Price = 
    CALCULATE(
        MIN('Table'[Price ]),
        REMOVEFILTERS('Table'[Contract_ID], 'Table'[Price ])
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;Because Month is a number and the way you have your data Anonymous&lt;/LI-USER&gt;&amp;nbsp;, you ned to make sure that the column is not summarized or the results will not be correct.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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;</description>
      <pubDate>Fri, 25 Jun 2021 18:13:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1923142#M41693</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-06-25T18:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1961321#M42903</link>
      <description>&lt;P&gt;Thanks for your help! (Sry for the late reply, I was on vacation.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I testet your solution on a small "testing data set" and it worked completly fine, but not on my "real" data set I'm working on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain why you've selected the column 'Contract ID' for the REMOVEFILTERS function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Felix&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 07:08:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1961321#M42903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-16T07:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1969128#M43217</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp; - sorry just getting back to you. Missed the notification.&lt;BR /&gt;&lt;BR /&gt;I didn't want the filter context from the table visual that was passing the current contract ID to affect the measure, so I removed that filter. The measure looks at&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; contract IDs to get the results. It keeps the filters though for the month ID and product.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:39:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1969128#M43217</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-07-20T20:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1974731#M43444</link>
      <description>&lt;P&gt;This explanation was super helpful!&lt;/P&gt;&lt;P&gt;I used the function ALLEXCEPT to solve my problem, but without you I would not have figured it out. Thanks!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":yellow_heart:"&gt;💛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 05:34:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1974731#M43444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T05:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Combine multiple DISTINCT statements to get the MIN value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1975552#M43465</link>
      <description>&lt;P&gt;Great&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;!&lt;BR /&gt;&lt;BR /&gt;Yup - ALLEXCEPT, REMOVEFILTERS, ALL, etc. within CALCULATE are different ways of doing the same thing depending on the circumstances. ALLEXCEPT can be more efficient depending on how many fields you have to remove the filters on.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 11:06:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Combine-multiple-DISTINCT-statements-to-get-the-MIN-value/m-p/1975552#M43465</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-07-23T11:06:17Z</dc:date>
    </item>
  </channel>
</rss>

