<?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: DAX: formula to get minimum value from the measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762052#M36887</link>
    <description>&lt;LI-CODE lang="csharp"&gt;[Diff from MIN] =
// ISINSCOPE guarantees that the visual
// you use the measure in uses T[Company]
// for grouping. Please DO NOT use this
// measure in other measures, especially
// those that include any explicit iterator.
// THIS IS A TOP-LEVEL MEASURE.
IF( ISINSCOPE( T[Company] ),
    var vMinPOPrice = 
        MINX(
            ALLSELECTED( T[Company] ),
            [PO Price]
        )
    var vResult =
        // This first DIVIDE makes sure BLANK
        // is returned when vMinPOPrice is 0.
        DIVIDE( vMinPOPrice, vMinPOPrice )
        * ( DIVIDE( [PO Price], vMinPOPrice ) - 1 )
    RETURN
        vResult
)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 02 Apr 2021 22:28:49 GMT</pubDate>
    <dc:creator>daxer-almighty</dc:creator>
    <dc:date>2021-04-02T22:28:49Z</dc:date>
    <item>
      <title>DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761882#M36872</link>
      <description>&lt;P&gt;Hi Team!&lt;/P&gt;&lt;P&gt;I would like to request you for the help with formula to get minimum value from the measure.&lt;/P&gt;&lt;P&gt;As a final result I would like to calculate the difference from minimum PO Price from all companies.&lt;/P&gt;&lt;P&gt;In Excel it's easy and looks like:&lt;/P&gt;&lt;P&gt;&lt;A title="Excel screen link" href="https://ibb.co/zJ2zzHG" target="_blank" rel="noopener"&gt;Excel screen link&lt;/A&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;However in PowerBI I stuck with getting that minimum value 0,8333 for all companies.&lt;/P&gt;&lt;P&gt;My results by error and trial there are following and nothing from them are correct.&lt;/P&gt;&lt;P&gt;Visualization has 3 Slices, which should be taken into account: Period, Reuse Flag and Generic SKU&lt;/P&gt;&lt;P&gt;&lt;A title="PowerBI screen link" href="https://ibb.co/zJHL7JL" target="_blank" rel="noopener"&gt;PowerBI screen link&lt;/A&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;PO Price =&lt;/P&gt;&lt;P&gt;DIVIDE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('Data_17_21_table'[PO Amount]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('Data_17_21_table'[PO Qty])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My trials with minimum value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min1 =&lt;/P&gt;&lt;P&gt;minx(VALUES(Data_17_21_table),[PO Price])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min2 =&lt;/P&gt;&lt;P&gt;MINX(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Data_17_21_table',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE([PO Price])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min3 =&lt;/P&gt;&lt;P&gt;MINX(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KEEPFILTERS(VALUES('Data_17_21_table'[FinYear])),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE([PO Price])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min4 =&lt;/P&gt;&lt;P&gt;MINX(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KEEPFILTERS(VALUES('Data_17_21_table'[BU])),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE([PO Price])&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min5 = minX(Data_17_21_table, DIVIDE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('Data_17_21_table'[PO Amount]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('Data_17_21_table'[PO Qty])&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min6 = CALCULATE(minx(VALUES(Data_17_21_table),[PO Price]), ALLEXCEPT(Data_17_21_table, Data_17_21_table[Reuse Flag], Data_17_21_table[Period], Data_17_21_table[Generic Sku]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min7 = CALCULATE(minx(VALUES(Data_17_21_table),[PO Price]), ALL(Data_17_21_table))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min8 = CALCULATE(minx(VALUES(Data_17_21_table),[PO Price]), ALLCROSSFILTERED(Data_17_21_table))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Min9 =&lt;/P&gt;&lt;P&gt;CALCULATE(MINX(VALUES(Data_17_21_table),[PO Price]),ALLEXCEPT(Data_17_21_table, Data_17_21_table[Generic Sku], Data_17_21_table[Period], Data_17_21_table[Reuse Flag]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you suggest another approach?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;rhoex&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 16:19:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761882#M36872</guid>
      <dc:creator>rhoex</dc:creator>
      <dc:date>2021-04-02T16:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761969#M36876</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;&lt;BR /&gt;Replace the column with measures. Also use allexcept to remove effect of all filters except the ones the you want to apply (you have to write the three filter columns in all except ).&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;M_Final = DIVIDE([M_SumProfit],CALCULATE(MIN(Sheet1[Profit]),ALL(Sheet1)),0)-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 18:20:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761969#M36876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-02T18:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761991#M36880</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you mean something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;M_Final_1 = DIVIDE([PO Price],CALCULATE(MIN(Data_17_21_table[PO Price]),ALL(Data_17_21_table)),0)-1&lt;/P&gt;&lt;P&gt;I have information:&amp;nbsp;Column 'PO Price' in table 'Data_17_21_table' cannot be found or may not be used in this expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and with&amp;nbsp;allexcept, the same error&lt;/P&gt;&lt;P&gt;M_Final_2 = DIVIDE([PO Price],CALCULATE(MIN(Data_17_21_table[PO Price])ALLEXCEPT(Data_17_21_table, Data_17_21_table[Generic Sku], Data_17_21_table[Period], Data_17_21_table[Reuse Flag])),0)-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I understand for measure I should use MINX function, and:&lt;/P&gt;&lt;P&gt;M_Final_3 = DIVIDE([PO Price],CALCULATE(MINX(VALUES(Data_17_21_table),[PO Price]),ALLEXCEPT(Data_17_21_table, Data_17_21_table[Generic Sku], Data_17_21_table[Period], Data_17_21_table[Reuse Flag])),0)-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this returns values not as I would expect. Actually it's similar approach as in Min9 above, so no proper minimum value taken &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 19:10:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761991#M36880</guid>
      <dc:creator>rhoex</dc:creator>
      <dc:date>2021-04-02T19:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761992#M36881</link>
      <description>&lt;P&gt;I forgot to mention and maybe this is important. PowerBI screen is showing already visualisation in Matrix. This is not table from Data. In Data_17_21_table I have much more transactions and in Matrix I am summarising this per Company&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 19:14:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1761992#M36881</guid>
      <dc:creator>rhoex</dc:creator>
      <dc:date>2021-04-02T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762052#M36887</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Diff from MIN] =
// ISINSCOPE guarantees that the visual
// you use the measure in uses T[Company]
// for grouping. Please DO NOT use this
// measure in other measures, especially
// those that include any explicit iterator.
// THIS IS A TOP-LEVEL MEASURE.
IF( ISINSCOPE( T[Company] ),
    var vMinPOPrice = 
        MINX(
            ALLSELECTED( T[Company] ),
            [PO Price]
        )
    var vResult =
        // This first DIVIDE makes sure BLANK
        // is returned when vMinPOPrice is 0.
        DIVIDE( vMinPOPrice, vMinPOPrice )
        * ( DIVIDE( [PO Price], vMinPOPrice ) - 1 )
    RETURN
        vResult
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Apr 2021 22:28:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762052#M36887</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-04-02T22:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762185#M36894</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294159" data-lia-user-login="rhoex" class="lia-mention lia-mention-user"&gt;rhoex&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I believe you have defined&amp;nbsp; "M_Final_1 = DIVIDE(&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;[PO Price],&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;CALCULATE(MIN(Data_17_21_table[PO Price]),ALL(Data_17_21_table)),0)-1"&lt;BR /&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;[PO Price]&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;as a measure. Can you please confirm that you have used the following pattern:&lt;BR /&gt;&lt;BR /&gt;M_Final_1 {Required Measure's Name }= DIVIDE({Measure of PO Price's Sum (or any other aggregation suiting your requirements},CALCULATE(MIN({Specificy PO Price Column here}),ALL(Data_17_21_table)),0)-1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2021 03:45:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762185#M36894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-03T03:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: formula to get minimum value from the measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762283#M36895</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255913" data-lia-user-login="daxer-almighty" class="lia-mention lia-mention-user"&gt;daxer-almighty&lt;/a&gt;&amp;nbsp;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is working as intented.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rhoex&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2021 09:10:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-to-get-minimum-value-from-the-measure/m-p/1762283#M36895</guid>
      <dc:creator>rhoex</dc:creator>
      <dc:date>2021-04-03T09:10:39Z</dc:date>
    </item>
  </channel>
</rss>

