<?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: Sorting problem with Text Field - mins, days, hrs in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4373875#M173664</link>
    <description>&lt;P&gt;It worked. Very Cool!! I have never used dynamic formatting before. Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 14:49:16 GMT</pubDate>
    <dc:creator>AmberJane</dc:creator>
    <dc:date>2025-01-21T14:49:16Z</dc:date>
    <item>
      <title>Sorting problem with Text Field - mins, days, hrs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372269#M173580</link>
      <description>&lt;P&gt;I have a measure that is taking a whole number for the dataset representing minutes and converting it to mins, days, hrs. This measure is a text column and as such when I try to filter it is not filtering the way I would like. Smallest to largest should always be mins &amp;gt; hrs &amp;gt; days. This is how it is currently sorting:&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>Mon, 20 Jan 2025 16:52:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372269#M173580</guid>
      <dc:creator>AmberJane</dc:creator>
      <dc:date>2025-01-20T16:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting problem with Text Field - mins, days, hrs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372513#M173588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353227" data-lia-user-login="AmberJane" class="lia-mention lia-mention-user"&gt;AmberJane&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest creating a measure with a &lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings" target="_blank" rel="noopener"&gt;dynamic format string&lt;/A&gt; for this, so that the measure is still evaluated as a numerical value (which can be sorted), but displayed with the appropriate formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would have to use a format string that produces the full text you want displayed enclosed in double quotes, conditional on the value (in minutes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've attached a small example showing how you could do this.&lt;/P&gt;
&lt;P&gt;The important part is 3rd piece of code below which is the expression for the dynamic format string.&lt;/P&gt;
&lt;P&gt;You could also use the expression you have already created for SLA Impact Converted, as long you enclose the result in double quotes similarly to below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SLA Impact = 
-- Underlying measure returning value in Minutes
SUM ( 'Table'[Duration mins] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;SLA Impact Converted = 
[SLA Impact]&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;-- FORMAT STRING for SLA Impact Converted
VAR NumberFormatString = "0.0#" -- change as required
VAR MinsPerDay = 24 * 60
VAR MinsPerHour = 60
VAR DoubleQuote = """"
VAR MeasureValue = SELECTEDMEASURE ()
VAR FormattedValue =
    SWITCH (
        TRUE (),
        MeasureValue &amp;gt;= MinsPerDay, FORMAT ( MeasureValue / MinsPerDay, NumberFormatString ) &amp;amp; " Days",
        MeasureValue &amp;gt;= MinsPerHour, FORMAT ( MeasureValue / MinsPerHour, NumberFormatString ) &amp;amp; " Hrs",
        FORMAT ( MeasureValue, NumberFormatString ) &amp;amp; " Mins"
    )
VAR Result =
    DoubleQuote &amp;amp; FormattedValue &amp;amp; DoubleQuote
RETURN
    Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Does something like this work for you?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 23:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372513#M173588</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2025-01-20T23:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting problem with Text Field - mins, days, hrs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372600#M173592</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353227" data-lia-user-login="AmberJane" class="lia-mention lia-mention-user"&gt;AmberJane&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;If these also don't help, please share more detailed information and description to help us clarify your scenario to test.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 01:59:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4372600#M173592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-21T01:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting problem with Text Field - mins, days, hrs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4373875#M173664</link>
      <description>&lt;P&gt;It worked. Very Cool!! I have never used dynamic formatting before. Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sorting-problem-with-Text-Field-mins-days-hrs/m-p/4373875#M173664</guid>
      <dc:creator>AmberJane</dc:creator>
      <dc:date>2025-01-21T14:49:16Z</dc:date>
    </item>
  </channel>
</rss>

