<?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: Custom Sort Order for a Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3243152#M119376</link>
    <description>&lt;P&gt;It is sorting alphabetically (descending). You can FORMAT your date as "MM/dd/yyyy" so that the zeros show up and you get the needed order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 22:33:08 GMT</pubDate>
    <dc:creator>ppm1</dc:creator>
    <dc:date>2023-05-18T22:33:08Z</dc:date>
    <item>
      <title>Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240515#M119209</link>
      <description>&lt;P&gt;I have the following measure which returns the screenshot of data below when applied to a matrix - essentially the date with a little calculation of how many days old the note is.&amp;nbsp;&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;StatusNoteDateFormatted = 
VAR DaysOld = 
    CALCULATE(
        DATEDIFF(
            SELECTEDVALUE('#Success - Project List'[ProjectStatusNoteDate]), 
            TODAY(),
            DAY
        )
    )
RETURN
        IF(
            DaysOld = BLANK(), 
            BLANK(), 
            SELECTEDVALUE('#Success - Project List'[ProjectStatusNoteDate]) &amp;amp; " (" &amp;amp; DaysOld &amp;amp; " Days Old)"
        )&lt;/LI-CODE&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;When you click the matrix header to sort chronologically, it sorts numerically rather than by the date.&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp;&lt;BR /&gt;5/9&lt;/P&gt;&lt;P&gt;5/8&lt;/P&gt;&lt;P&gt;5/5&lt;/P&gt;&lt;P&gt;5/3&lt;/P&gt;&lt;P&gt;5/12&lt;/P&gt;&lt;P&gt;5/11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like it to sort chronologically, oldest to newest or vice versa.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found &lt;A href="https://powerbi.tips/2019/09/custom-sort-order-within-a-dax-measure/" target="_self"&gt;this article&lt;/A&gt; which shows how to introduce a custom sort order to a measure but they only have 3 specific categories wheras my measure is dynamic based on the value of Status Note Date. Does anyone have any other methods similar where I could make this measure sort by date (or even by the count of days old) rather than numeric order when the column header is clicked?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 15:07:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240515#M119209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T15:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240551#M119213</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Mark the datetime column (or take out from this column) and mark that sort column for Status Not Date &lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 15:14:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240551#M119213</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-05-17T15:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240794#M119234</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;, thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately Status Note Date Formatted is a measure which is the column you see in the visual (Status Note Date). I was under the impression you can't define a column to sort a measure by.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 17:11:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3240794#M119234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-17T17:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3242910#M119361</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;I converted my measure to a calculated column so that I could use the method you described. I'm still having a problem though. In data view, you can see that the calculated column is being sorted by ProjectStatusNoteDate (which is marked as a date field) and the sort is in the correct order.&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;However, when I go to my visual it is still out of order. In descending order, we see 5/5, 5/3, 5/2, then 5/11, 5/10, 4/29 and so on.&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;I've tried resorting the visual many times and continue to get the same result. Is there anything else I can try?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 18:46:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3242910#M119361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-18T18:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3243152#M119376</link>
      <description>&lt;P&gt;It is sorting alphabetically (descending). You can FORMAT your date as "MM/dd/yyyy" so that the zeros show up and you get the needed order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 22:33:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3243152#M119376</guid>
      <dc:creator>ppm1</dc:creator>
      <dc:date>2023-05-18T22:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3244669#M119473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443516" data-lia-user-login="ppm1" class="lia-mention lia-mention-user"&gt;ppm1&lt;/a&gt;&amp;nbsp;thanks for your response. So the sort by column (StatusNoteDate) I changed the date format to&amp;nbsp;"MM/dd/yyyy". I can't format the calculated column (StatusNoteDate&amp;amp;DaysOld) that way since I am adding a string, it can't be both date and string. But if I sort the Calculated column by StatusNoteDate, it sorts in the correct order in data view but is still going alphabetical in the visual.&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 16:21:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3244669#M119473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-19T16:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3244691#M119476</link>
      <description>&lt;P&gt;I meant you can FORMAT the date in your measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FORMAT(SELECTEDVALUE(...), "yyyy/MM/dd")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 19 May 2023 16:31:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3244691#M119476</guid>
      <dc:creator>ppm1</dc:creator>
      <dc:date>2023-05-19T16:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Sort Order for a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3248054#M119754</link>
      <description>&lt;P&gt;Oh I understand now, thank you. This works!!&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 15:20:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Custom-Sort-Order-for-a-Measure/m-p/3248054#M119754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-22T15:20:03Z</dc:date>
    </item>
  </channel>
</rss>

