<?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: Question about the MAXX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1414366#M26266</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After filter A, D, H, the result will be "H" and 25-6 = "19", as 19 is more then (D-A&amp;nbsp;)&amp;nbsp;&amp;nbsp; 6-2="4". Actually, I have incremental date column instead of letters column in reality. I put the table with letters here&amp;nbsp;for simpicity (with my opinion).&lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2020 05:10:33 GMT</pubDate>
    <dc:creator>VSIM</dc:creator>
    <dc:date>2020-10-06T05:10:33Z</dc:date>
    <item>
      <title>Question about the MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1413749#M26235</link>
      <description>&lt;P&gt;Hello. I have&amp;nbsp;similar table:&lt;BR /&gt;I want to find the max&amp;nbsp;difference between rows in column "Numbers" and corresponding letter in "Letters" to show them in 2 KPI visuals in the reports (as a result, I mean to get "F" and 8, as the maximum difference from the numbers rows is between 20 and 12, and not 5-2, or 9-5, or 6-9, or 12-6....). Can anybody tell me how to write the measure for that? Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 18:57:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1413749#M26235</guid>
      <dc:creator>VSIM</dc:creator>
      <dc:date>2020-10-05T18:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1413830#M26242</link>
      <description>This is not clear. What happens when somebody filters the table by letters: A, D, H? What result do you expect?</description>
      <pubDate>Mon, 05 Oct 2020 20:13:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1413830#M26242</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2020-10-05T20:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1414366#M26266</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After filter A, D, H, the result will be "H" and 25-6 = "19", as 19 is more then (D-A&amp;nbsp;)&amp;nbsp;&amp;nbsp; 6-2="4". Actually, I have incremental date column instead of letters column in reality. I put the table with letters here&amp;nbsp;for simpicity (with my opinion).&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 05:10:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1414366#M26266</guid>
      <dc:creator>VSIM</dc:creator>
      <dc:date>2020-10-06T05:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1415302#M26292</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// Let's call the table T.

[Max Diff Value] =
// It does not matter whether
// the Letters column stores
// letters or numbers or dates
// as long as the entries may
// be sorted.
var __lettersWithDiffs =
    GENERATE(
        T,
        var __currentLetter = T[Letter]
        var __currentNumber = T[Number]
        // can be BLANK if we're on the first
        // letter as seen in the current
        // context
        var __prevLetter =
            MAXX(
                filter(
                    T,
                    T[Letter] &amp;lt; __currentLetter
                ),
                T[Letter]
            )
        // can be BLANK if we're on the first
        // letter as seen in the current
        // context
        var __prevNumber =
            MAXX(
                filter(
                    T,
                    T[Letter] = __prevLetter
                ),
                T[Number]
            )
        var __diff =
            __currentNumber - __prevNumber
        RETURN
            row(
                "@PrevLetter", __prevLetter,
                "@Diff", __diff
            )
    )
var __maxDiff =
    MAXX(
        __lettersWithDiffs,
        [@Diff]
    )
RETURN
    __maxDiff&lt;/LI-CODE&gt;&lt;P&gt;and the first letter where the max diff is found:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Max Diff Letter] =
// It does not matter whether
// the Letters column stores
// letters or numbers or dates
// as long as the entries may
// be sorted.
var __lettersWithDiffs =
    GENERATE(
        T,
        var __currentLetter = T[Letter]
        var __currentNumber = T[Number]
        // can be BLANK if we're on the first
        // letter as seen in the current
        // context
        var __prevLetter =
            MAXX(
                filter(
                    T,
                    T[Letter] &amp;lt; __currentLetter
                ),
                T[Letter]
            )
        // can be BLANK if we're on the first
        // letter as seen in the current
        // context
        var __prevNumber =
            MAXX(
                filter(
                    T,
                    T[Letter] = __prevLetter
                ),
                T[Number]
            )
        var __diff =
            __currentNumber - __prevNumber
        RETURN
            row(
                "@PrevLetter", __prevLetter,
                "@Diff", __diff
            )
    )
var __maxDiffLetter =
    MAXX(
        TOPN(1,
            __lettersWithDiffs,
            // this sorts by the differences
            // in a descending order
            [@Diff],
            DESC,
            // and this sorts within the
            // same differences by letters
            // in an ascending order
            T[Letter],
            ASC
        ),
        T[Letter]
    )
RETURN
    __maxDiffLetter&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 11:54:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1415302#M26292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-06T11:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Question about the MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1415316#M26293</link>
      <description>Of course, the stuff above works correctly but you should understand that if you put the measures in a table and then drop the letters onto rows, they will be calculating values for THIS ROW ONLY. If you want to get these measures calculated on a selection of rows, then you have to put the measures onto a card or check the measures' values on the Total row in a table or in a matrix.</description>
      <pubDate>Tue, 06 Oct 2020 12:05:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Question-about-the-MAXX/m-p/1415316#M26293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-06T12:05:25Z</dc:date>
    </item>
  </channel>
</rss>

