<?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: MIN MAX Calculation DAX for visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4075874#M161829</link>
    <description>&lt;P&gt;Thank you so much for your efforts and apologies for the delayed response. It works fine at first look. One thing that i did not tell you is that i will use the slicer for products and year as well. So this needs to update according to the items selected in the slicers. So just replaced All with AllSelected and it works well so far.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Aug 2024 11:36:08 GMT</pubDate>
    <dc:creator>KKVerma</dc:creator>
    <dc:date>2024-08-02T11:36:08Z</dc:date>
    <item>
      <title>MIN MAX Calculation DAX for visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4051311#M160747</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table like below&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have preapred the stacked bar chart like above from this dataset. I am trying to get the minimum/Maximum value amongst all the years. which means i am creating a 2 measures which will return minimum and maximum. the answer should come as for Minimum - (-550) and the maximum should be (400) despite any year being selected. i will use this minimum and maximum value to control the scale of y axis.&amp;nbsp;However, my calculation is returning(-230):&lt;/P&gt;&lt;P&gt;MINIMUMCALC =&lt;BR /&gt;Var _T1 = CALCULATETABLE(&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;VALUES(TestTable[Year]),"@MIN",CALCULATE(SUM(TestTable[Amount]))&lt;BR /&gt;)&lt;BR /&gt;,&lt;BR /&gt;ALLSELECTED()&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;MINX(_T1,[@MIN])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help please?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 19:56:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4051311#M160747</guid>
      <dc:creator>KKVerma</dc:creator>
      <dc:date>2024-07-19T19:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: MIN MAX Calculation DAX for visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4051620#M160761</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;y_axis_minus_min: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE ( ALL ( test_fct ), year_dim[year], product_dim[product] ),
            "@amount", CALCULATE ( SUM ( test_fct[amount] ) )
        ),
        [@amount] &amp;lt; 0
    )
VAR _result =
    GROUPBY ( _t, year_dim[year], "@minus", SUMX ( CURRENTGROUP (), [@amount] ) )
RETURN
    MINX ( _result, [@minus] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;y_axis_plus_max: = 
VAR _t =
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE ( ALL ( test_fct ), year_dim[year], product_dim[product] ),
            "@amount", CALCULATE ( SUM ( test_fct[amount] ) )
        ),
        [@amount] &amp;gt; 0
    )
VAR _result =
    GROUPBY ( _t, year_dim[year], "@minus", SUMX ( CURRENTGROUP (), [@amount] ) )
RETURN
    MAXX ( _result, [@minus] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 04:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4051620#M160761</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-07-20T04:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: MIN MAX Calculation DAX for visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4075874#M161829</link>
      <description>&lt;P&gt;Thank you so much for your efforts and apologies for the delayed response. It works fine at first look. One thing that i did not tell you is that i will use the slicer for products and year as well. So this needs to update according to the items selected in the slicers. So just replaced All with AllSelected and it works well so far.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 11:36:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MIN-MAX-Calculation-DAX-for-visual/m-p/4075874#M161829</guid>
      <dc:creator>KKVerma</dc:creator>
      <dc:date>2024-08-02T11:36:08Z</dc:date>
    </item>
  </channel>
</rss>

