<?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 Transform SQL Formula Into DAX Measure For Total Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transform-SQL-Formula-Into-DAX-Measure-For-Total-Sales/m-p/1291501#M22210</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SQL formula from SQL Developer that i'm trying to translate into DAX measure formula. Its taking orders from a fact table that status key = (25,133) then from another fact table with a filter and finally if true then sum the price from the third table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the formula i have from SQL Developer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Sum( case when ODS_OWNER.FACT_FULFILLMENT.FULFILLED_STATUS_KEY in(25,133) then (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case when (DECODE(BITAND(ODS_OWNER.FACT_ORDER_LINE.ORDER_LINE_FLG,&amp;nbsp; POWER(2 , 0)),POWER(2 , 0), '1', '0')) = 1 then 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else ODS_OWNER.FCT_SHIP_GRP_ITEM.FULFILLMENT_ITEM_PRICE&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;END) else 0 end )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Aug 2020 19:12:36 GMT</pubDate>
    <dc:creator>hibarrbm</dc:creator>
    <dc:date>2020-08-12T19:12:36Z</dc:date>
    <item>
      <title>Transform SQL Formula Into DAX Measure For Total Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transform-SQL-Formula-Into-DAX-Measure-For-Total-Sales/m-p/1291501#M22210</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SQL formula from SQL Developer that i'm trying to translate into DAX measure formula. Its taking orders from a fact table that status key = (25,133) then from another fact table with a filter and finally if true then sum the price from the third table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the formula i have from SQL Developer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Sum( case when ODS_OWNER.FACT_FULFILLMENT.FULFILLED_STATUS_KEY in(25,133) then (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case when (DECODE(BITAND(ODS_OWNER.FACT_ORDER_LINE.ORDER_LINE_FLG,&amp;nbsp; POWER(2 , 0)),POWER(2 , 0), '1', '0')) = 1 then 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else ODS_OWNER.FCT_SHIP_GRP_ITEM.FULFILLMENT_ITEM_PRICE&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt;END) else 0 end )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:12:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transform-SQL-Formula-Into-DAX-Measure-For-Total-Sales/m-p/1291501#M22210</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-12T19:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transform SQL Formula Into DAX Measure For Total Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transform-SQL-Formula-Into-DAX-Measure-For-Total-Sales/m-p/1291732#M22238</link>
      <description>&lt;P&gt;That is some really deep PLSQL...&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;Bitand(ods_owner.fact_order_line.order_line_flg, Power(2, 0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Isn't that just checking if&amp;nbsp; fact_order_line_flg is an odd number? You can use the MOD function for that. The equivalent for Decode seems to be COALESCE()&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 23:20:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Transform-SQL-Formula-Into-DAX-Measure-For-Total-Sales/m-p/1291732#M22238</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-08-12T23:20:33Z</dc:date>
    </item>
  </channel>
</rss>

