<?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: Problem using IF with new column (Syntax error) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974984#M11767</link>
    <description>&lt;P&gt;What is the language version of your Desktop?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Mar 2020 20:01:49 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-03-15T20:01:49Z</dc:date>
    <item>
      <title>Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974960#M11762</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm following this guide ( &lt;A href="https://insightsoftware.com/blog/working-with-weeks-in-power-bi/" target="_blank" rel="noopener"&gt;https://insightsoftware.com/blog/working-with-weeks-in-power-bi/&lt;/A&gt; ) to get week numbers, day numbers and names for my dataset. I'm able to add 2 new columns for the week/day numbers just like in the guide.&lt;BR /&gt;I'm failing at the step to add the day names column.&lt;/P&gt;&lt;P&gt;I'm adding the column with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Day Name = IF('123it_otrs time_accounting'[Week Day]=1,"Monday",
IF('123it_otrs time_accounting'[Week Day]=2, "Tuesday",
IF('123it_otrs time_accounting'[Week Day]=3, "Wednesday",
IF('123it_otrs time_accounting'[Week Day]=4, "Thursday",
IF('123it_otrs time_accounting'[Week Day]=5, "Friday",
IF('123it_otrs time_accounting'[Week Day]=6, "Saturday", "Sunday"))))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and I'm getting the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The syntax for '"Monday"' is incorrect. (DAX(IF('123it_otrs time_accounting'[Week Day]=1."Monday",IF('123it_otrs time_accounting'[Week Day]=2. "Tuesday",IF('123it_otrs time_accounting'[Week Day]=3. "Wednesday",IF('123it_otrs time_accounting'[Week Day]=4. "Thursday",IF('123it_otrs time_accounting'[Week Day]=5. "Friday",IF('123it_otrs time_accounting'[Week Day]=6. "Saturday", "Sunday")))))))).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure wher I'm going wrong and I'm starting to think the issue is that I have to use ' ' to access my columns?&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:35:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974960#M11762</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T19:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974961#M11763</link>
      <description>&lt;P&gt;I'll take a closer look in a minute, but in general, avoid nested IF statements and use SWITCH instead. Way cleaner.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974961#M11763</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T19:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974964#M11764</link>
      <description>&lt;P&gt;Good comment, (I agree), but I'm getting the exact same error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SWITCH('123it_otrs time_accounting'[Week Day], 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saterday", 7, "Sunday") &lt;/LI-CODE&gt;&lt;P&gt;Unexpected expression starting at "Monday".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to this and still following guides, so I may be failing to grasp the basic concepts here.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974964#M11764</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T19:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974968#M11765</link>
      <description>&lt;P&gt;Yeah, that's bizarre because I copied and pasted your code and it worked perfectly for me. Perhaps something wrong with quotes or double quotes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both of these worked, PBIX is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a column, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Day Name = IF('123it_otrs time_accounting'[Week Day]=1,"Monday",
IF('123it_otrs time_accounting'[Week Day]=2, "Tuesday",
IF('123it_otrs time_accounting'[Week Day]=3, "Wednesday",
IF('123it_otrs time_accounting'[Week Day]=4, "Thursday",
IF('123it_otrs time_accounting'[Week Day]=5, "Friday",
IF('123it_otrs time_accounting'[Week Day]=6, "Saturday", "Sunday"))))))


Day Name 2 = 
    SWITCH([Week Day],
        1,"Monday",
        2,"Tuesday",
        3,"Wednesday",
        4,"Thursday",
        5,"Friday",
        6,"Saturday",
        "Sunday"
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:50:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974968#M11765</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T19:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974980#M11766</link>
      <description>&lt;P&gt;Thank you for attaching the example file.&lt;/P&gt;&lt;P&gt;When I open the file, it's good, when I select the column, I see the expression, it gives me an error and it breaks.:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 19:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974980#M11766</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T19:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974984#M11767</link>
      <description>&lt;P&gt;What is the language version of your Desktop?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:01:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974984#M11767</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T20:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974987#M11768</link>
      <description>&lt;P&gt;I'm on a Windows 10 Pro, The display language is set to English (United States), The preferred languages are "English (Belgium)"/"English (United Kingdom)".&lt;BR /&gt;&lt;BR /&gt;I did not realise this might work like Office, where formulas follow the language. But it should be english.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:06:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974987#M11768</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T20:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974991#M11769</link>
      <description>&lt;P&gt;In the powerBI options, regional settings, I forced everything to English (United states), but still the same issue.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:12:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974991#M11769</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T20:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974994#M11770</link>
      <description>&lt;P&gt;Wait, try semi-colons instead of commas.&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215386" data-lia-user-login="JayB" class="lia-mention lia-mention-user"&gt;JayB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:15:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/974994#M11770</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T20:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975000#M11771</link>
      <description>&lt;P&gt;Googling I also found a post where they suggested to use ;, is this what you mean?&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;The "intellisense?" example does show me to use ,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using integers instaid of strings does work. So it's something about the strings.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:25:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975000#M11771</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T20:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975003#M11772</link>
      <description>&lt;P&gt;OK, try single quotes??&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:30:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975003#M11772</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T20:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975004#M11773</link>
      <description>&lt;P&gt;Right, sry, I didn't bother to post that, but I have tried that. Same issue. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:39:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975004#M11773</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T20:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975010#M11774</link>
      <description>&lt;P&gt;OK, this is highly strange. File | Options and settings | Options | Diagnostics, What version of the Desktop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, under Regional Settings what are those:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 20:41:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975010#M11774</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T20:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975029#M11775</link>
      <description>&lt;P&gt;I'm on version 2.79.5768.721 64-bit (March 2020).&lt;/P&gt;&lt;P&gt;I ran PowerBI on my local machine, and your example file ran just fine. (I'm using a VM and RDP to it).&lt;BR /&gt;In the VM I've set all regional settings to the United states, I've manually set all powerbi regional settings to united states (This where on that already) and rebooted. And now it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To conclude. I want to apologise for wasting your time, this was not a DAX question, but "how do I use powerbi". (I sure wasted a lot of time this week trying to gras why even the most basic things failed for me). I didn't realise this worked like Excel, where if you change the language, formulas change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 21:12:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975029#M11775</guid>
      <dc:creator>JayB</dc:creator>
      <dc:date>2020-03-15T21:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using IF with new column (Syntax error)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975034#M11776</link>
      <description>&lt;P&gt;No worries&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215386" data-lia-user-login="JayB" class="lia-mention lia-mention-user"&gt;JayB&lt;/a&gt;&amp;nbsp;I've just been working on a blog post and answering forum questions most of the day. Nothing to do with everything shut down over COVID-19!!&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 21:15:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-using-IF-with-new-column-Syntax-error/m-p/975034#M11776</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-15T21:15:30Z</dc:date>
    </item>
  </channel>
</rss>

