<?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: DAX Error when using If Statement with DateAdd in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649643#M141372</link>
    <description>&lt;P&gt;i just attached the PBIX file....if that helps&lt;/P&gt;&lt;P&gt;&lt;A title="PBIX File" href="https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa" target="_self"&gt;https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jan 2024 15:43:44 GMT</pubDate>
    <dc:creator>wasirafi</dc:creator>
    <dc:date>2024-01-20T15:43:44Z</dc:date>
    <item>
      <title>DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649592#M141360</link>
      <description>&lt;P&gt;&lt;A title="PowerBI File" href="https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa" target="_self"&gt;https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa&lt;/A&gt;&amp;nbsp; - PBIX File&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi PB Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am trying to use If statement in my DAX expression as below&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;new date1 =&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'bi v_shift'&lt;/SPAN&gt;&lt;SPAN&gt;[shiftName]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"night"&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;SPAN&gt;'bi v_shift'&lt;/SPAN&gt;&lt;SPAN&gt;[startOffsetMinutes]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;55&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'bi v_shift'&lt;/SPAN&gt;&lt;SPAN&gt;[dateTimeNearestHour]&lt;/SPAN&gt;&lt;SPAN&gt;,-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'bi v_shift'&lt;/SPAN&gt;&lt;SPAN&gt;[dateTimeNearestHour]&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I get the below error&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"A single value for column 'dateTimeNearestHour' in table 'bi v_shift' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All i want is if Shift name is "night" and StartOffsetMinutes is greater than 55 minutes, then the Date in Datetimenearesthour should go back by 1 day.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FYI Datetimenearesthour is Date/time type, i changed it to DAte time still getting errors.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am fine with Either Column or Measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="362560" data-lia-user-login="Ahmedx" class="lia-mention lia-mention-user"&gt;Ahmedx&lt;/a&gt;&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;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A title="Spreadsheet" href="https://1drv.ms/x/s!AjIGh95acxebg6JCE8e6Z9-lxdzq5A?e=buS51O" target="_self"&gt;https://1drv.ms/x/s!AjIGh95acxebg6JCE8e6Z9-lxdzq5A?e=buS51O&lt;/A&gt;&amp;nbsp;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:42:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649592#M141360</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T15:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649600#M141361</link>
      <description>&lt;P&gt;We want to help you but your description is too vaugue. Please write it again clearly.&lt;/P&gt;&lt;P&gt;Please DON'T copy &amp;amp; paste your DAX that does not work and expect us to fathom what you want to do. That is a bit crazy. &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please just give a simple non technical functional decscription of what you want, then let us suggest the solution. Thank you.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Also provide the example desired output, with a clear description of the process flow.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Remember not to share private data ... we don't want you to get into trouble. &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt;&lt;BR /&gt;Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.&lt;BR /&gt;Try keep it simple and ask one question per ticket.&lt;BR /&gt;You will get a quick response if you put time, care and effort into writing clear problem descriptions.&lt;/P&gt;&lt;P&gt;Vaugue descriptions can waste your time and ourtime.&lt;/P&gt;&lt;P&gt;Look foward to helping you when the above information is forthcoming&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 14:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649600#M141361</guid>
      <dc:creator>speedramps</dc:creator>
      <dc:date>2024-01-20T14:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649609#M141363</link>
      <description>&lt;P&gt;Attached spreadsheet!!&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 14:54:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649609#M141363</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649614#M141365</link>
      <description>&lt;P&gt;replace the following expression &lt;BR /&gt;DATEADD('bi v_shift'[dateTimeNearestHour],-1,DAY) &lt;BR /&gt;with &lt;BR /&gt;&lt;FONT color="#FF0000"&gt;bi v_shift'[dateTimeNearestHour]-1&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:01:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649614#M141365</guid>
      <dc:creator>Ahmedx</dc:creator>
      <dc:date>2024-01-20T15:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649619#M141366</link>
      <description>&lt;P&gt;still the same error&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:08:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649619#M141366</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649623#M141367</link>
      <description>&lt;P&gt;remove these ( ) &lt;BR /&gt;I also advise you to give columns and tables a normal name without spaces or hyphens.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649623#M141367</guid>
      <dc:creator>Ahmedx</dc:creator>
      <dc:date>2024-01-20T15:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649629#M141368</link>
      <description>&lt;P&gt;Ahmed,&lt;/P&gt;&lt;P&gt;I only removed "()" not the content inside it, as that is the second IF criteria.&lt;/P&gt;&lt;P&gt;I did note your point on not having Spaces and Hypen in the name of the table. The Dataset is owned by 3rd party and i cannot influence that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error still remains&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;</description>
      <pubDate>Sat, 20 Jan 2024 15:19:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649629#M141368</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T15:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649631#M141369</link>
      <description>&lt;P&gt;Is this columns in this table or in another?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:22:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649631#M141369</guid>
      <dc:creator>Ahmedx</dc:creator>
      <dc:date>2024-01-20T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649633#M141370</link>
      <description>&lt;P&gt;All the columns are from the same Table.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:24:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649633#M141370</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649643#M141372</link>
      <description>&lt;P&gt;i just attached the PBIX file....if that helps&lt;/P&gt;&lt;P&gt;&lt;A title="PBIX File" href="https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa" target="_self"&gt;https://1drv.ms/u/s!AjIGh95acxebg6JDCZEPNu4K7yIYQg?e=i1Vuqa&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:43:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649643#M141372</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T15:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649647#M141373</link>
      <description>&lt;P&gt;pls try this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF(
        'bi v_shift'[shiftName]= "night"&amp;amp;&amp;amp; 
        'bi v_shift'[startOffsetMinutes]&amp;gt;55,
        'bi v_shift'[dateTimeNearestHour].[Date]-1,
        'bi v_shift'[dateTimeNearestHour].[Date]
        )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 15:54:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649647#M141373</guid>
      <dc:creator>Ahmedx</dc:creator>
      <dc:date>2024-01-20T15:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error when using If Statement with DateAdd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649660#M141375</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="362560" data-lia-user-login="Ahmedx" class="lia-mention lia-mention-user"&gt;Ahmedx&lt;/a&gt;&amp;nbsp; You were very helpful&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jan 2024 16:21:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-when-using-If-Statement-with-DateAdd/m-p/3649660#M141375</guid>
      <dc:creator>wasirafi</dc:creator>
      <dc:date>2024-01-20T16:21:31Z</dc:date>
    </item>
  </channel>
</rss>

