<?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: compare text to time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062408#M105897</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try to use TIMEVALUE function to convert Duration to datetime data type as follows&lt;/P&gt;
&lt;P&gt;Duration =&lt;BR /&gt;VAR _ref =&lt;BR /&gt;MAX ( a[REF] )&lt;BR /&gt;VAR _time1 =&lt;BR /&gt;MAXX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )&lt;BR /&gt;VAR _time2 =&lt;BR /&gt;MINX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )&lt;BR /&gt;RETURN&lt;BR /&gt;TIMEVALUE ( FORMAT ( _time2 - _time1, "hh:mm" ) )&lt;/P&gt;</description>
    <pubDate>Sun, 05 Feb 2023 17:57:38 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-02-05T17:57:38Z</dc:date>
    <item>
      <title>compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062152#M105860</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to see if my Actual is less than my target but they are in different formats. both are measures however 1 has been formatted into HH:MM so its a text and the other is a normal short time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;the text time measure is as follows:&amp;nbsp;&lt;SPAN&gt;Actual= Format(example),"hh:mm)&amp;nbsp; -&amp;nbsp; result is 02.45&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the Target measure might say 03:55 (in short time format)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the if formula is not working due to formatting issues :&lt;/P&gt;&lt;P&gt;if(actual&amp;lt;target,1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please assist&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 09:45:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062152#M105860</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2023-02-05T09:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062158#M105862</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
IF(
    VALUE([Actual])&amp;lt; [Target], 
    1, 0 
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;verified with such data:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Actual = FORMAT(TIME(2,45,0), "hh:mm")

Target = TIME(1,55,0)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 09:57:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062158#M105862</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-05T09:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062160#M105863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can use&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;IF ( TIMEVALUE ( actual ) &amp;lt; target, 1, 0 )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 09:59:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062160#M105863</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-05T09:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062161#M105864</link>
      <description>&lt;P&gt;change the target, returns 1&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 09:59:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062161#M105864</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-05T09:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062192#M105866</link>
      <description>&lt;P&gt;Tried this but says i cant convert value " of type txt to type date&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 11:13:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062192#M105866</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2023-02-05T11:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062194#M105867</link>
      <description>&lt;P&gt;also&amp;nbsp;Tried this but says i cant convert value " of type txt to type date&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 11:13:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062194#M105867</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2023-02-05T11:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062197#M105869</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you paste your data?&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 11:29:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062197#M105869</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-05T11:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062389#M105892</link>
      <description>&lt;P&gt;the actual:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Duration = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&g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V&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;the Target: (i have this as a measure and a column, both not worked)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Target = 'Task Rules'[Earliest Start]+'Task Rules'[Duration]+'Task Rules'[Endbefore]+'Task Rules'[Setup]+'Task Rules'[Cleanup]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Feb 2023 17:07:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062389#M105892</guid>
      <dc:creator>AI14</dc:creator>
      <dc:date>2023-02-05T17:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: compare text to time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062408#M105897</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474512" data-lia-user-login="AI14" class="lia-mention lia-mention-user"&gt;AI14&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try to use TIMEVALUE function to convert Duration to datetime data type as follows&lt;/P&gt;
&lt;P&gt;Duration =&lt;BR /&gt;VAR _ref =&lt;BR /&gt;MAX ( a[REF] )&lt;BR /&gt;VAR _time1 =&lt;BR /&gt;MAXX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )&lt;BR /&gt;VAR _time2 =&lt;BR /&gt;MINX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )&lt;BR /&gt;RETURN&lt;BR /&gt;TIMEVALUE ( FORMAT ( _time2 - _time1, "hh:mm" ) )&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 17:57:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/compare-text-to-time/m-p/3062408#M105897</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-05T17:57:38Z</dc:date>
    </item>
  </channel>
</rss>

