<?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: Calculating the Minimum Value Across Multiple Months in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599096#M176074</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Your current DAX formula for MinValue Visible is calculating the minimum within the current month instead of considering all selected months. The issue is likely caused by the ALLSELECTED(Datum[Month]) filter, which does not ensure that all months remain in scope correctly.&lt;/P&gt;
&lt;P&gt;Corrected DAX Measure&lt;BR /&gt;Try modifying your MinValue Visible measure as follows:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinValue Visible =
VAR CurrentCountry = SELECTEDVALUE(Countries[Country])
RETURN
CALCULATE(
MIN([FBA Switch]),
ALLSELECTED(Datum),
FILTER(ALL(Countries), Countries[Country] = CurrentCountry)
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Explanation of Fix:&lt;BR /&gt;ALLSELECTED(Datum): Ensures that all months in the selected range remain in context.&lt;BR /&gt;MIN([FBA Switch]): Now correctly calculates the minimum value across all selected months for the same country.&lt;BR /&gt;FILTER(ALL(Countries), Countries[Country] = CurrentCountry): Maintains the filter on the selected country.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Expected Outcome&lt;BR /&gt;Now, for each row (month), the MinValue Visible column should show the same minimum value across all selected months for that country instead of just repeating FBA Switch for that specific month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark this post as solution if it helps you. Appreciate Kudos.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Mar 2025 17:31:31 GMT</pubDate>
    <dc:creator>FarhanJeelani</dc:creator>
    <dc:date>2025-03-06T17:31:31Z</dc:date>
    <item>
      <title>Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599064#M176072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate the min-value for multiple months, so that for each month, the min-value reflects the actual minimum value across all selected months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have this formula for the FBA Switch:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FBA Switch =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Countries&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"AT"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Spend FBA AT]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt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;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(Datum[Month]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt; &lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;([FBA Switch])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [FBA Switch]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Countries), Countries[Country] = CurrentCountry)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, the result is that the min-value always equals the &lt;STRONG&gt;FBA Switch&lt;/STRONG&gt; value for the current month, when it should instead return the &lt;STRONG&gt;minimum value across all the months&lt;/STRONG&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any input on how to fix this is much appreciated!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thx!&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Mar 2025 17:13:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599064#M176072</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-06T17:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599096#M176074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Your current DAX formula for MinValue Visible is calculating the minimum within the current month instead of considering all selected months. The issue is likely caused by the ALLSELECTED(Datum[Month]) filter, which does not ensure that all months remain in scope correctly.&lt;/P&gt;
&lt;P&gt;Corrected DAX Measure&lt;BR /&gt;Try modifying your MinValue Visible measure as follows:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinValue Visible =
VAR CurrentCountry = SELECTEDVALUE(Countries[Country])
RETURN
CALCULATE(
MIN([FBA Switch]),
ALLSELECTED(Datum),
FILTER(ALL(Countries), Countries[Country] = CurrentCountry)
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Explanation of Fix:&lt;BR /&gt;ALLSELECTED(Datum): Ensures that all months in the selected range remain in context.&lt;BR /&gt;MIN([FBA Switch]): Now correctly calculates the minimum value across all selected months for the same country.&lt;BR /&gt;FILTER(ALL(Countries), Countries[Country] = CurrentCountry): Maintains the filter on the selected country.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Expected Outcome&lt;BR /&gt;Now, for each row (month), the MinValue Visible column should show the same minimum value across all selected months for that country instead of just repeating FBA Switch for that specific month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark this post as solution if it helps you. Appreciate Kudos.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 17:31:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599096#M176074</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-03-06T17:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599935#M176094</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thanks for your reply and your explanation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use your measure I get the following error message:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The ‘MIN’ function only accepts a column reference as argument no. 1.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I tried MINX.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 07:08:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4599935#M176094</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-07T07:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600013#M176096</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can use below any of the measure for min value.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Min Value = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
    ALLEXCEPT('Table','Table'[Country] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Min Value 2 = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
    ALL( 'Table' ),
    VALUES( 'Table'[Country] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Min Value 3 = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
WINDOW(1,ABS,1,REL,
SUMMARIZE( ALLSELECTED( 'Table'), 'Table'[Country], 'Table'[Monat] ),
ORDERBY( SUM('Table'[FBA Switch]),ASC), PARTITIONBY( 'Table'[Country] )
) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below screenshots&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Hope it helps&lt;/P&gt;
&lt;P&gt;Let me know if you need pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;sanalytics&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 08:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600013#M176096</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2025-03-07T08:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600014#M176097</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can use below any of the measure for min value.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Min Value = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
    ALLEXCEPT('Table','Table'[Country] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Min Value 2 = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
    ALL( 'Table' ),
    VALUES( 'Table'[Country] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Min Value 3 = 
CALCULATE(
    MIN( 'Table'[FBA Switch] ),
WINDOW(1,ABS,1,REL,
SUMMARIZE( ALLSELECTED( 'Table'), 'Table'[Country], 'Table'[Monat] ),
ORDERBY( SUM('Table'[FBA Switch]),ASC), PARTITIONBY( 'Table'[Country] )
) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below screenshots&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Hope it helps&lt;/P&gt;
&lt;P&gt;Let me know if you need pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;sanalytics&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 08:28:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600014#M176097</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2025-03-07T08:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600242#M176104</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="195725" data-lia-user-login="sanalytics" class="lia-mention lia-mention-user"&gt;sanalytics&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, it doesn't work and I think it's because [FBA Switch] is a measure and not in a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a Test-Power BI file where I inserted the test-data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/cwrrlew3lic0az2/Min-Value-test.pbix?st=4rc9cx9p&amp;amp;dl=0" target="_self"&gt;Test-File&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(It's a dropbox link - just open in a new tab - you don't need to register, you can download the file regardless).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you could have a look?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 10:43:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600242#M176104</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-07T10:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600273#M176106</link>
      <description>&lt;P&gt;I don't think you need any logic around country. Try this to expand the date context:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinValue Visible =
    MINX(CALCULATETABLE(VALUES(Datum[Month]),ALL(Datum), ALLSELECTED(Datum[Month])),
        [FBA Switch]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 11:00:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600273#M176106</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-03-07T11:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600290#M176107</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226664" data-lia-user-login="sjoerdvn" class="lia-mention lia-mention-user"&gt;sjoerdvn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried your measure. MinValue Visible is returning the values for FBA Switch for each month, but not the actual min-value over all selected months for a particular country, which would bei 41,72 for AT and 11,44 for BE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Fri, 07 Mar 2025 11:07:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600290#M176107</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-07T11:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600300#M176109</link>
      <description>&lt;P&gt;There's no way to tell without more info: what are the columns you are using in that visual? what slicers are in place? what's the definition of the meaures used within the "FBA SWITCH" ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try adding these measure below to see where it fails, they both should return "3". If the 1st one doesn't the issue is in the date context. If the 2nd doesn't the issue is in that measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Debug1 = COUNTROWS(CALCULATETABLE(VALUES(Datum[Month]),ALL(Datum), ALLSELECTED(Datum[Month]))

Debug2 = COUNTX(CALCULATETABLE(VALUES(Datum[Month]),ALL(Datum), ALLSELECTED(Datum[Month])),[FBA Switch])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 11:31:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4600300#M176109</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-03-07T11:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601014#M176135</link>
      <description>&lt;P&gt;I've created a PBI&amp;nbsp;&lt;A href="https://www.dropbox.com/s/uhuxktgk5o48fos/Min-Value-test_02.pbix?st=yatlkkb5&amp;amp;dl=0" target="_self"&gt;test-file&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;maybe this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(It's a dropbox link - just open in a new tab - you don't need to register, you can download the file regardless).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've also tried your 2 debugging measures and here's the result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 19:03:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601014#M176135</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-07T19:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601219#M176146</link>
      <description>&lt;P&gt;First, clean up your Spend/Country measures. What you are doing with [Spend FBA AT], [Spend FBA BE], [Spend FBA CH], and [Spend FBA Switch] we usually achieve with relationships:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) create a relationship between Countries -1--M-&amp;gt; Spend (you already have dates related to spend, we are doing the same here)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;2) now you can just have the following measure that automatically is filtered by Countries in your visuals:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Spend FBA = SUM( Spend[Spend] )&lt;/LI-CODE&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;Now, you can do something like this to get the min spend by country:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Spend FBA Country Min = 
VAR _iter = 
GENERATE( 
    VALUES( Countries[Country] ), 
    ALLSELECTED( DateTable[Date_DateTable].[Monat] ) 
)
RETURN
MINX( 
    _iter,
    VAR _thisMo = [Date_DateTable].[Monat] RETURN
    IF( 
        NOT ISEMPTY( Spend ), 
        CALCULATE( 
            [Spend FBA], 
            DateTable[Date_DateTable].[Monat] = _thisMo, 
            REMOVEFILTERS( DateTable ) 
        ) 
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 22:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601219#M176146</guid>
      <dc:creator>MarkLaf</dc:creator>
      <dc:date>2025-03-07T22:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601459#M176158</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use below pbix file for your solution.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;May i ask why Country dimension is disconnected.?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;sanalytics&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2025 05:58:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4601459#M176158</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2025-03-08T05:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4606990#M176359</link>
      <description>&lt;P&gt;Ok, so it turns out that expanding the context within an "X" function get hideously complex. I got something that works though. Some extra notes: You really should replace the "Month" with a month-year column. Also, you should add an IF statementment to make sure not to return values outside the selected date range.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Min Value = 
    MINX(
        SUMMARIZE(
            CALCULATETABLE(VALUES(DateTable[Month]),ALL(DateTable), TREATAS(ALLSELECTED(DateTable[Date_DateTable]),DateTable[Date_DateTable]))
                ,[Month]
                ,"Spend",VAR sm=[Month] RETURN CALCULATE([Spend FBA Switch], ALL(DateTable), DateTable[Month]=sm))
        ,[Spend]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Mar 2025 13:16:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4606990#M176359</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-03-12T13:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4609063#M176437</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="195725" data-lia-user-login="sanalytics" class="lia-mention lia-mention-user"&gt;sanalytics&lt;/a&gt;&amp;nbsp;Thanks for your help!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="195725" data-lia-user-login="sanalytics" class="lia-mention lia-mention-user"&gt;sanalytics&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;May i ask why Country dimension is disconnected.?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sure! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The reason is that I have provided a simplified Test-file... in the real file there isn't an actual country dimension because I get the country-data from campaigns running on for example Facebook. On Facebook I have the countries segmented with campaign-names, like [AT]Campaign_1 for a campaign running in Austria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I have created a switch-statement:&lt;BR /&gt;&lt;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lt;SPAN&gt;"CH"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Schweiz"&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;which I then use in combination with data from the Facebook-campaigns, like ad spend to create a Matrix-Table like this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And therefore I wanted to have the Min- and Max-Values which I can then use for conditional formatting. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Mar 2025 16:57:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4609063#M176437</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-13T16:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4609075#M176438</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="51073" data-lia-user-login="MarkLaf" class="lia-mention lia-mention-user"&gt;MarkLaf&lt;/a&gt;&amp;nbsp;Thanks for your reply and your suggested solution!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="51073" data-lia-user-login="MarkLaf" class="lia-mention lia-mention-user"&gt;MarkLaf&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;First, clean up your Spend/Country measures. What you are doing with [Spend FBA AT], [Spend FBA BE], [Spend FBA CH], and [Spend FBA Switch] we usually achieve with relationship:&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's because of the simplied test-file. In the actual file I don't have columns with countries and spend which I could conntect. I get the data with a connector out of Facebook, for example, and there I only have campaigns that I can attribute to countries based on the campaign name.&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>Thu, 13 Mar 2025 17:06:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4609075#M176438</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-13T17:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4610388#M176483</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226664" data-lia-user-login="sjoerdvn" class="lia-mention lia-mention-user"&gt;sjoerdvn&lt;/a&gt;&amp;nbsp;thanks again for your effort and the new Measure!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works pretty well. I've made some adjustments and I also implemented your tipps regarding "month-year-column" and the "IF-statement":&lt;/P&gt;&lt;P&gt;&amp;nb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sp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(Datum[Year-Month]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Datum),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(Datum[DateAll]), Datum[DateAll])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Datum[Year-Month],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"CPL"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; sm = Datum[Year-Month]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [CPL FBA Base], &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Datum), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Datum[Year-Month] = sm&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AND&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(Datum[DateAll]) &amp;gt;= SelectedMinDate,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(Datum[DateAll]) &amp;lt;= SelectedMaxDate&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [CPL],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in combination with Min and Max I was then able to create the following conditional formatting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CPL_FBA_ColorScale = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; CurrentCountry = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(Countries[Country])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; MinValue = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([CPL_FBA_Min], &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Countries), Countries[Country] = CurrentCountry)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; MaxValue = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([CPL_FBA_Max], &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Countries), Countries[Country] = CurrentCountry)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; CurrentValue = [CPL FBA Switch] &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Range = MaxValue - MinValue&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(CurrentValue), &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(Range = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0.5&lt;/SPAN&gt;&lt;SPAN&gt;, (CurrentValue - MinValue) / Range))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;======&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So the end result is that I can now display different countries (X, Y, Z) with groups (A, B, C,...) where each group is formatted so that the maximum value across all months is red, the minimum value is green, and the values in between are yellow—based on each group/country itself.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So, thanks again for your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The only problem I have now is a performance issue... too many countries and groups in combination make conditional formatting for each group quite resource-intensive and push it to its performance limits... but at least it's working!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Mar 2025 14:41:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4610388#M176483</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-14T14:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4612793#M176541</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Had another look into it, and it turns out it can actually be a bit less complex. Also, the "IF" to supress results outside the date range in scope is best implemented at the highest level, so not inside the MINX.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF (AND(
        MIN(DateTable[Date_DateTable])&amp;lt;=MAXX(ALLSELECTED(DateTable[Date_DateTable]),[Date_DateTable]),
        MAX(DateTable[Date_DateTable])&amp;gt;=MINX(ALLSELECTED(DateTable[Date_DateTable]),[Date_DateTable])
    ),
    MINX(
        SUMMARIZE(
            CALCULATETABLE(ALLSELECTED(DateTable[Month]))
                ,[Month]
                ,"Spend",VAR sm=[Month] RETURN CALCULATE([Spend FBA Switch], ALL(DateTable), DateTable[Month]=sm))
        ,[Spend]
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Mar 2025 12:28:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4612793#M176541</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2025-03-17T12:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the Minimum Value Across Multiple Months</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4613367#M176557</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226664" data-lia-user-login="sjoerdvn" class="lia-mention lia-mention-user"&gt;sjoerdvn&lt;/a&gt;&amp;nbsp; Thanks - I'll definitely check this out!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 17:37:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-the-Minimum-Value-Across-Multiple-Months/m-p/4613367#M176557</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2025-03-17T17:37:07Z</dc:date>
    </item>
  </channel>
</rss>

