<?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: Calculate min value of a column then select to return corresponding text value from another column. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135294#M49026</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;First I want to thank you so much for working on this.&amp;nbsp;I am a beginner.&lt;BR /&gt;Something is strange with TopN because it looks is not cheking complete dataset, even if I use it on a chart and apply TopN on "page filter" it gives different result if I select TopN 1 item or 5 items.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below formula returns "blank" and works only if I filter some of the countries.&lt;BR /&gt;What should be added to select first value for the&amp;nbsp;&lt;SPAN&gt;"card visual"&lt;/SPAN&gt;, in case &lt;SPAN&gt;2 cities have same value&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;MinQuantity =&lt;BR /&gt;VAR MinPollutant =&lt;BR /&gt;MINX(Table,Table[TotalPollutantQuantity])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SELECTEDVALUE ( Table[city]),&lt;BR /&gt;Table[TotalPollutantQuantity] = MinPollutant,&lt;BR /&gt;KEEPFILTERS(VALUES(Table[city]))&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 14:52:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-14T14:52:02Z</dc:date>
    <item>
      <title>Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2134995#M49013</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with a DAX formula that would return city name (need to use "card visual") by calculating the minimum value of a numeric column. And in case 2 cities have same value to select the first value. In below example for the Card Visual I wanted to have the city "San Roque".&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;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 12:30:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2134995#M49013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-14T12:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135060#M49015</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MinQuantity = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table'[city]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;TOPN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Table'[TotalPollutantQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ASC&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jori&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;If I answered your question, please mark it as a solution to help other members find it more quickly.&lt;STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/joripallada/" target="_blank"&gt;Connect on Linkedin&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Oct 2021 13:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135060#M49015</guid>
      <dc:creator>jppv20</dc:creator>
      <dc:date>2021-10-14T13:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135294#M49026</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;First I want to thank you so much for working on this.&amp;nbsp;I am a beginner.&lt;BR /&gt;Something is strange with TopN because it looks is not cheking complete dataset, even if I use it on a chart and apply TopN on "page filter" it gives different result if I select TopN 1 item or 5 items.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Below formula returns "blank" and works only if I filter some of the countries.&lt;BR /&gt;What should be added to select first value for the&amp;nbsp;&lt;SPAN&gt;"card visual"&lt;/SPAN&gt;, in case &lt;SPAN&gt;2 cities have same value&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;MinQuantity =&lt;BR /&gt;VAR MinPollutant =&lt;BR /&gt;MINX(Table,Table[TotalPollutantQuantity])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SELECTEDVALUE ( Table[city]),&lt;BR /&gt;Table[TotalPollutantQuantity] = MinPollutant,&lt;BR /&gt;KEEPFILTERS(VALUES(Table[city]))&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 14:52:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135294#M49026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-14T14:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135339#M49031</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry but I it is not really clear to me what is not working with the TopN. Also, when I copy your formula I receive an error. Can you explain a bit more?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 15:04:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135339#M49031</guid>
      <dc:creator>jppv20</dc:creator>
      <dc:date>2021-10-14T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135475#M49038</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I shared a printscreen below. Something is not calculating correct -&amp;gt; try to replace for the table where is country/city/totalpollutant instead of "Don't Summarize" with min of&amp;nbsp;TotalPollutantQuantity.&amp;nbsp; Maybe issue comes because are different values for different dates?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And you can download pbix file from here&amp;nbsp;&lt;A title="PBIX File" href="https://drive.google.com/drive/folders/1RmitcIJtDbvruahf7UdQKOxaS9ysMMQ-?usp=sharing" target="_self"&gt;https://drive.google.com/drive/folders/1RmitcIJtDbvruahf7UdQKOxaS9ysMMQ-?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sorry, formula I sent had mistake, was missin these '' for table.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MinQuantity2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR MinPollutant =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MINX('Table','Table'[TotalPollutantQuantity])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE ('Table'[city]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Table'[TotalPollutantQuantity] = MinPollutant,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS(VALUES('Table'[city]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Thank you very much!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 16:54:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2135475#M49038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-14T16:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136684#M49067</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you change "Top 5" to "Bottom 5" for the chart you will get this result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the card, what is the desired output there?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 07:19:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136684#M49067</guid>
      <dc:creator>jppv20</dc:creator>
      <dc:date>2021-10-15T07:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136836#M49071</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for this. I really appreciate it!&lt;BR /&gt;&lt;BR /&gt;I just wanted that all 3 visuals (card, table, and chart (with top5) would show the same result (the correct one), to display the cleansest city (min pollutant).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;_For the chart to show same result as the card have to use "Min" of TotalPollutantQuantity.&lt;BR /&gt;_For the table to show same results I have to use "Don't Summarize"&amp;nbsp;TotalPollutantQuantity.&lt;/P&gt;&lt;P&gt;_But if I use a Matrix Table as there&amp;nbsp;"Don't Summarize" is not available have to use also&amp;nbsp; "Min" of TotalPollutantQuantity.&lt;BR /&gt;&lt;BR /&gt;Your first answer was perfect and will accept it as solution, the chart and table were showing different results and I was not understanding what is happening, until I chaged for the table to have from Min to "Don't Summarize".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 08:01:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136836#M49071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-15T08:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136966#M49073</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just in case you have time, if I want to create a card with average value for same dataset, replacing the "Min" with "Average" in your formula, I get the error on the card "Average cannot work with values of type String", what would be the workaround for the measure?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 08:57:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2136966#M49073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-15T08:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate min value of a column then select to return corresponding text value from another column.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2137050#M49074</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For calculating average value you can use AVERAGE(&lt;SPAN&gt;Table'[TotalPollutantQuantity])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 09:39:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-min-value-of-a-column-then-select-to-return/m-p/2137050#M49074</guid>
      <dc:creator>jppv20</dc:creator>
      <dc:date>2021-10-15T09:39:58Z</dc:date>
    </item>
  </channel>
</rss>

