<?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: Price difference of identical products across different companies - min max values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2282069#M55857</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283692" data-lia-user-login="v-kkf-msft" class="lia-mention lia-mention-user"&gt;v-kkf-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer. This was already really useful. Much appreciated. However, I do not get the correct outcome yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have implemented the measures and I have now this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I check the purchase order data, the min / max values are incorrect. See for example the AP000000006522 code when I look in the purchase order data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I shoul expect of all these values the min value of 2.97 and the max value 3.28&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I also look at your PBIX, I see that the figures are not right. So I am expecting this for product x as min / max values:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while I get the values 10 and 11&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we are close by but not there yet.&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;&lt;P&gt;What the next step would be (additional request) is to see over time how the price evolves&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jan 2022 16:25:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-13T16:25:34Z</dc:date>
    <item>
      <title>Price difference of identical products across different companies - min max values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2273958#M55414</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question regarding comparing prices of identical items. I did not find the right answer yet on this forum. I will explain my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compare purchase prices of different companies based on the global product ID. Here is an example of a table (dummy data):&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;I want to achieve two things here:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Create a matrix of the pricing of the same global product of the different companies&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;2. Calculate the min and max values of these records, the difference and calculate the ordered quantity from the purchase orders:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following model (three different tables) and the relations&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The combined key is the company code + the local product ID (to make them unique).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it is clear and I will get an answer on this case soon!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated and many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Roelof de Jong&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jan 2022 11:19:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2273958#M55414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-09T11:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: Price difference of identical products across different companies - min max values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2278590#M55683</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not knowing your exact data, so I created the following simple example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Price = SUM ( Fact_Purchase_Orders[Price in EUR] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Min = 
MINX ( 
    SUMMARIZE (
        Fact_Purchase_Orders,
        Dim_Product_Global[Global Product Code],
        Dim_Product_Local[Product Company Code]
    ),
    [Price]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Max = 
MAXX ( 
    SUMMARIZE (
        Fact_Purchase_Orders,
        Dim_Product_Global[Global Product Code],
        Dim_Product_Local[Product Company Code]
    ),
    [Price]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Difference = [Max] - [Min]&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Ordered quantity = COUNTROWS ( Fact_Purchase_Orders )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;QTY*difference = [Difference] * [Ordered quantity]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Winniz&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 01:57:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2278590#M55683</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2022-01-12T01:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Price difference of identical products across different companies - min max values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2282069#M55857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283692" data-lia-user-login="v-kkf-msft" class="lia-mention lia-mention-user"&gt;v-kkf-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer. This was already really useful. Much appreciated. However, I do not get the correct outcome yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have implemented the measures and I have now this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I check the purchase order data, the min / max values are incorrect. See for example the AP000000006522 code when I look in the purchase order data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I shoul expect of all these values the min value of 2.97 and the max value 3.28&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I also look at your PBIX, I see that the figures are not right. So I am expecting this for product x as min / max values:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while I get the values 10 and 11&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So we are close by but not there yet.&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;&lt;P&gt;What the next step would be (additional request) is to see over time how the price evolves&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 16:25:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2282069#M55857</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-13T16:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Price difference of identical products across different companies - min max values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2283407#M55908</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you want to keep only the filter on the [Global Product Code] column, please try the following measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Min = 
CALCULATE ( 
    Min ( Fact_Purchase_Orders[Price in EUR] ),
    filter (
        ALL ( Fact_Purchase_Orders ),
        Fact_Purchase_Orders[Global Product Code] = MAX ( Fact_Purchase_Orders[Global Product Code] )  
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Max = 
CALCULATE ( 
    MAX ( Fact_Purchase_Orders[Price in EUR] ),
    filter (
        ALL ( Fact_Purchase_Orders ),
        Fact_Purchase_Orders[Global Product Code] = MAX ( Fact_Purchase_Orders[Global Product Code] )  
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to calculate the min\max value in the column based on context, please try the following measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_max = MAX(Fact_Purchase_Orders[Price in EUR])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;_min = MIN(Fact_Purchase_Orders[Price in EUR])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&amp;nbsp;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Winniz&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 09:11:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2283407#M55908</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2022-01-14T09:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Price difference of identical products across different companies - min max values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2283526#M55917</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/283692" target="_blank"&gt;@v-kkf-msft&lt;/A&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was indeed the solution. Many thanks and much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 10:08:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Price-difference-of-identical-products-across-different/m-p/2283526#M55917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-14T10:08:11Z</dc:date>
    </item>
  </channel>
</rss>

