<?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: Converting SQl logic to DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2680902#M80286</link>
    <description>&lt;P&gt;First, click on the DAX query button in SSMS.&lt;BR /&gt;This will launch the screen that lets you select and connect to the SSAS Server with the Tabular Database you install above.&lt;BR /&gt;Make sure you select the database you want to query.&lt;BR /&gt;Proceed to write and execute your DAX queries.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;J Wick&lt;/P&gt;</description>
    <pubDate>Thu, 04 Aug 2022 08:10:05 GMT</pubDate>
    <dc:creator>Jameswalter</dc:creator>
    <dc:date>2022-08-04T08:10:05Z</dc:date>
    <item>
      <title>Converting SQl logic to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2676768#M80022</link>
      <description>&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working on getting transfering this expression as a measue in a tabular model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SQL is accurate but running into issues on the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQL:&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN Sale_Type = 'Upsell'&lt;BR /&gt;AND Product IN('SaaS')&lt;BR /&gt;AND NULLIF( DATEDIFF( DD,Start_Date], ISNULL( Renewal_date],end_date ) ) + 1,0 ) &amp;gt; 364&lt;BR /&gt;THEN ARR&lt;BR /&gt;ELSE TotalPrice&lt;BR /&gt;END AS 'TotalContractualValue'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX Attempt:&amp;nbsp;&lt;BR /&gt;SWITCH( Sale_Type = "Upsell" &amp;amp;&amp;amp; Product IN ("SaaS")&lt;BR /&gt;&amp;amp;&amp;amp; DateDiff ( StartDate], IF( ISBLANK( RenewalDate), EndDate, RenewalDate, DAY ) + 1 &amp;gt; 364,&amp;nbsp;ARR&lt;BR /&gt;TotalPrice ) )))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, no matter how I word this or break it down, I end up with the same warning message and error:&lt;/P&gt;&lt;P&gt;Severity Code Description Project File Line Suppression State&lt;BR /&gt;Operator or expression '( )' is not supported in this context.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 00:02:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2676768#M80022</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-03T00:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQl logic to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2677111#M80032</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try this as new column Not measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SWITCH( True() ,&lt;BR /&gt;[Sale_Type] = "Upsell" &amp;amp;&amp;amp; [Product] IN ("SaaS")&lt;BR /&gt;&amp;amp;&amp;amp; DateDiff ( StartDate], IF( ISBLANK( RenewalDate), EndDate, RenewalDate), DAY ) + 1 &amp;gt; 364, [ARR],&lt;BR /&gt;[TotalPrice] )&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 03:46:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2677111#M80032</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-08-03T03:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQl logic to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2678814#M80132</link>
      <description>&lt;P&gt;Thank you&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;BR /&gt;Unfortunately, this needs to be a measure&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 13:47:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2678814#M80132</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-03T13:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQl logic to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2680902#M80286</link>
      <description>&lt;P&gt;First, click on the DAX query button in SSMS.&lt;BR /&gt;This will launch the screen that lets you select and connect to the SSAS Server with the Tabular Database you install above.&lt;BR /&gt;Make sure you select the database you want to query.&lt;BR /&gt;Proceed to write and execute your DAX queries.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;J Wick&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 08:10:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2680902#M80286</guid>
      <dc:creator>Jameswalter</dc:creator>
      <dc:date>2022-08-04T08:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Converting SQl logic to DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2686893#M80735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;Thanks for reaching out to us.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;CASE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHEN Sale_Type = 'Upsell'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AND Product IN('SaaS')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AND NULLIF( DATEDIFF( DD,Start_Date], ISNULL( Renewal_date],end_date ) ) + 1,0 ) &amp;gt; 364&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;THEN ARR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE TotalPrice&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;END AS 'TotalContractualValue'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;measure code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _datediff=DATEDIFF(MIN('Table'[Start_Date]),IF(ISBLANK(MIN('Table'[Renewal_date])),MIN('Table'[end_date]),MIN('Table'[Renewal_date])),DAY)+1
var _istrue= _datediff&amp;gt;364
return
IF(MIN('Table'[Sale_Type])="Upsell" &amp;amp;&amp;amp; MIN('Table'[Product]) in {"SaaS"} &amp;amp;&amp;amp; _istrue, [ARR],[TotalPrice] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Community Support Team _Tang&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 02:28:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Converting-SQl-logic-to-DAX/m-p/2686893#M80735</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-09-06T02:28:28Z</dc:date>
    </item>
  </channel>
</rss>

