<?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: IF formular in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760135#M3151</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159770" data-lia-user-login="SN1900" class="lia-mention lia-mention-user"&gt;SN1900&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the below column expression.&lt;/P&gt;&lt;PRE&gt;Column = 
SWITCH(
    TRUE(),
    'Table'[Delivery Appointment DATE] = 'Table'[Event Date NEW UTC], "On Time",
    'Table'[Delivery Appointment DATE] &amp;gt; 'Table'[Event Date NEW UTC], "Late",
    "Early"
)&lt;/PRE&gt;&lt;P&gt;Result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2019 08:56:10 GMT</pubDate>
    <dc:creator>Mariusz</dc:creator>
    <dc:date>2019-08-07T08:56:10Z</dc:date>
    <item>
      <title>IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760110#M3150</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue with an IF formular as I do not now how i can build the if formular in Power BI as I am quite new in Power BI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two&amp;nbsp; different columns from two data fields with a date. Now I want to compare the dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Idea: IF both dates match than it would be "on Time".&lt;/P&gt;&lt;P&gt;Otherwise it should be saying : too late or too early depends on the date.&lt;/P&gt;&lt;P&gt;In Excel my formular would be:&lt;/P&gt;&lt;P&gt;IF(Delivery Appointment DATE=Event Date NEW UTC ;"On Time";IF(Delivery Appointment DATE&amp;lt;Event Date NEW UTC;"Early";"Late"))&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks and best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 08:39:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760110#M3150</guid>
      <dc:creator>SN1900</dc:creator>
      <dc:date>2019-08-07T08:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760135#M3151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159770" data-lia-user-login="SN1900" class="lia-mention lia-mention-user"&gt;SN1900&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the below column expression.&lt;/P&gt;&lt;PRE&gt;Column = 
SWITCH(
    TRUE(),
    'Table'[Delivery Appointment DATE] = 'Table'[Event Date NEW UTC], "On Time",
    'Table'[Delivery Appointment DATE] &amp;gt; 'Table'[Event Date NEW UTC], "Late",
    "Early"
)&lt;/PRE&gt;&lt;P&gt;Result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 08:56:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760135#M3151</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-08-07T08:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760181#M3154</link>
      <description>Why are you doing this in DAX instead of in Power Query, where this calculation truly belongs?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Wed, 07 Aug 2019 09:23:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760181#M3154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-07T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760288#M3164</link>
      <description>&lt;P&gt;Hi Mariusz,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your fast&amp;nbsp; response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your formular by adding the new column with the formular in the dataset shipment Analysis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore I could only select the "Delivery Appointment" data as dropdown and I had too enter in the "Event data new utc" manually as this data comes from another field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I reiceved this error message saying:A single value for column "event data new utc" in table "otm event status cannot" be determined.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just for your information.&lt;/P&gt;&lt;P&gt;It is possible that there are more event dates but only one delivery appointment date. could that be the issue?&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;Many thanks and best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Niclas&amp;nbsp;&lt;/P&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;P&gt;&amp;nbsp;&lt;/P&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 10:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760288#M3164</guid>
      <dc:creator>SN1900</dc:creator>
      <dc:date>2019-08-07T10:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760300#M3167</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159770" data-lia-user-login="SN1900" class="lia-mention lia-mention-user"&gt;SN1900&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry the solution I gave you works on the assumption that the data was in one table, what is the relationship between this tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 10:58:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760300#M3167</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-08-07T10:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760353#M3169</link>
      <description>&lt;P&gt;Hi Mariusz,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relationship between the tables is a shipment ID number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is one Delivery Appointment date. So one ID number has one delivery appointment date.&lt;/P&gt;&lt;P&gt;But every ID nummber can have multiple event date based on the Status code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compare the Delivery appointment date only&amp;nbsp; with the Event date that has the Status code delivered to see which ones are delivered on time and which not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 12:04:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760353#M3169</guid>
      <dc:creator>SN1900</dc:creator>
      <dc:date>2019-08-07T12:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: IF formular</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760445#M3174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159770" data-lia-user-login="SN1900" class="lia-mention lia-mention-user"&gt;SN1900&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the below.&lt;/P&gt;&lt;PRE&gt;Column = 
VAR x = (
    CALCULATE(
        MAX( Event[Event Date NEW UTC] ), 
        Event[STATUS] = "DELIVERED" 
    ) - Delivery[Delivery Appointment DATE] 
) * 1
RETURN 
SWITCH(
    TRUE,
    x = 0, "On Time",
    x &amp;gt; 0, "Late",
    "Early"
)&lt;/PRE&gt;&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 13:24:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-formular/m-p/760445#M3174</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-08-07T13:24:14Z</dc:date>
    </item>
  </channel>
</rss>

