<?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 Trouble with IF AND statements in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304213#M22621</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble translating my Excel formula into DAX. I'm not sure where I'm going wrong and I'm pretty new to DAX expression so any help would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula is:&lt;/P&gt;&lt;P&gt;=IFERROR(IF(AND([@[Current Calendar Entry]]="Booked to a Project",[@[Current Calendar Project Supervising Entity 1]]="Other"),"Int. Role",IF([@[Current Calendar Entry]]="Booked To A Project",VLOOKUP([@[Current Calendar Project Supervising Entity 1]],Lookup!$I:$J,2,0),VLOOKUP([@[Current Calendar Entry]],Lookup!$W:$X,2,FALSE))),"Other")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 18 Aug 2020 13:11:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-18T13:11:15Z</dc:date>
    <item>
      <title>Trouble with IF AND statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304213#M22621</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble translating my Excel formula into DAX. I'm not sure where I'm going wrong and I'm pretty new to DAX expression so any help would be much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula is:&lt;/P&gt;&lt;P&gt;=IFERROR(IF(AND([@[Current Calendar Entry]]="Booked to a Project",[@[Current Calendar Project Supervising Entity 1]]="Other"),"Int. Role",IF([@[Current Calendar Entry]]="Booked To A Project",VLOOKUP([@[Current Calendar Project Supervising Entity 1]],Lookup!$I:$J,2,0),VLOOKUP([@[Current Calendar Entry]],Lookup!$W:$X,2,FALSE))),"Other")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 13:11:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304213#M22621</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-18T13:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with IF AND statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304238#M22625</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- Well you don't say what is going wrong. Formatting your code I get:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=IFERROR(
	IF(
		AND(
			[@[Current Calendar Entry]]="Booked to a Project",
			[@[Current Calendar Project Supervising Entity 1]]="Other"
                ),
		"Int. Role",
		IF(
			[@[Current Calendar Entry]]="Booked To A Project",
			VLOOKUP([@[Current Calendar Project Supervising Entity 1]],Lookup!$I:$J,2,0),
			VLOOKUP([@[Current Calendar Entry]],Lookup!$W:$X,2,FALSE)
		)
	),
	"Other"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Couple things. VLOOKUP is not a DAX function you need to use something like LOOKUPVALUE. Also, I would use SWITCH(TRUE(),...) instead of nested IF statements.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might help:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 13:20:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304238#M22625</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-18T13:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with IF AND statements</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304258#M22629</link>
      <description>&lt;P&gt;Ah good to know! Thanks for your help, as I said I'm new to this. I'll check out the link you attached&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 13:27:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trouble-with-IF-AND-statements/m-p/1304258#M22629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-18T13:27:11Z</dc:date>
    </item>
  </channel>
</rss>

