<?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: Token Comma Expected Error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297599#M22414</link>
    <description>&lt;LI-CODE lang="csharp"&gt;// I'd shorten the name of the table
// ODS_OWNER FACT_ORDER_LINE. If you
// can shorten the names of the columns
// - even better.

[Your Measure] =
CALCULATE(
    0 + SUM (
        'ODS_OWNER FACT_ORDER_LINE'[TOTAL_SALE_PRICE] 
    ),
    KEEPFILTERS(
        'ODS_OWNER FACT_ORDER_LINE'[ORDER_LINE_FLG] &amp;lt;&amp;gt; 1
    ),
    KEEPFILTERS(
        'ODS_OWNER FACT_ORDER_LINE'[ORDER_STATUS_KEY]
        IN {25, 133}
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 15 Aug 2020 00:30:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-15T00:30:52Z</dc:date>
    <item>
      <title>Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297472#M22406</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm receiving the "Token Comma Expected" error for script below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;= CALCULATE ( VAR TotalSalePrice = CALCULATE ( SUMX ( 'ODS_OWNER FACT_ORDER_LINE', IF ( 'ODS_OWNER FACT_ORDER_LINE'[ORDER_LINE_FLG] = 1, 0, 'ODS_OWNER FACT_ORDER_LINE'[TOTAL_SALE_PRICE] ) ) ) RETURN COALESCE ( TotalSalePrice, 0 ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how to resolve?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 21:57:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297472#M22406</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-14T21:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297559#M22407</link>
      <description>&lt;P&gt;You can always use Daxformatter.com to check your code.&amp;nbsp; In this case it comes back clean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;a =
CALCULATE (
    VAR TotalSalePrice =
        CALCULATE (
            SUMX (
                'ODS_OWNER FACT_ORDER_LINE',
                IF (
                    'ODS_OWNER FACT_ORDER_LINE'[ORDER_LINE_FLG] = 1,
                    0,
                    'ODS_OWNER FACT_ORDER_LINE'[TOTAL_SALE_PRICE]
                )
            )
        )
    RETURN
        COALESCE ( TotalSalePrice, 0 )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the outer CALCULATE() looks suspicious.&amp;nbsp; I don't think it is required.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 23:30:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297559#M22407</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-08-14T23:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297570#M22410</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Your Measure] =
CALCULATE(
    0 + SUM ( 'ODS_OWNER FACT_ORDER_LINE'[TOTAL_SALE_PRICE] ),
    KEEPFILTERS( 'ODS_OWNER FACT_ORDER_LINE'[ORDER_LINE_FLG] &amp;lt;&amp;gt; 1 )
)&lt;/LI-CODE&gt;&lt;P&gt;Your expression is correct. If you have any problems with a formula and syntax, use &lt;A href="http://www.daxformatter.com" target="_blank"&gt;www.daxformatter.com&lt;/A&gt;. I've checked it and it's OK. But your formula is not only unnecessary complex. It's also slower than it could be. The version above is MUCH faster.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 23:57:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297570#M22410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T23:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297592#M22412</link>
      <description>&lt;P&gt;Thank you daxer! this worked perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also need to add an extra filter to the statement, i also need to only apply to order status key that = 25 or 133&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 0 + SUM ( 'ODS_OWNER FACT_ORDER_LINE' [TOTAL_SALE_PRICE]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; KEEPFILTERS( 'ODS_OWNER FACT_ORDER_LINE' [ORDER_STATUS_KEY] = (25,133)).&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; KEEPFILTERS( 'ODS_OWNER FACT_ORDER_LINE' [ORDER_LINE_FLG] &amp;lt;&amp;gt;1).&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hugo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2020 00:09:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297592#M22412</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-15T00:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297598#M22413</link>
      <description>&lt;P&gt;THis was the original SQL statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum( case when ODS_OWNER.FACT_ORDER_LINE.ORDER_STATUS_KEY in(25,133) then (&lt;/P&gt;&lt;P&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;/P&gt;&lt;P&gt;else ODS_OWNER.FACT_ORDER_LINE.TOTAL_SALE_PRICE&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2020 00:30:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297598#M22413</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-15T00:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297599#M22414</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// I'd shorten the name of the table
// ODS_OWNER FACT_ORDER_LINE. If you
// can shorten the names of the columns
// - even better.

[Your Measure] =
CALCULATE(
    0 + SUM (
        'ODS_OWNER FACT_ORDER_LINE'[TOTAL_SALE_PRICE] 
    ),
    KEEPFILTERS(
        'ODS_OWNER FACT_ORDER_LINE'[ORDER_LINE_FLG] &amp;lt;&amp;gt; 1
    ),
    KEEPFILTERS(
        'ODS_OWNER FACT_ORDER_LINE'[ORDER_STATUS_KEY]
        IN {25, 133}
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 15 Aug 2020 00:30:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297599#M22414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-15T00:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297606#M22417</link>
      <description>&lt;P class="lia-align-justify"&gt;Looks like the measure was accepted except now it returns back with zero. any idea why that is?&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2020 00:50:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297606#M22417</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-15T00:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297709#M22418</link>
      <description>&lt;P&gt;Apologizes, this is the second filter that needs to be applied. Once i updated the formula it gave me the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test Sales New = CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0 + SUM ( 'FACT_ORDER_LINE'[TOTAL_SALE_PRICE] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS ( 'FACT_ORDER_LINE'[ORDER_STATUS_KEY] &amp;lt;&amp;gt; {27,22,20,18,23,19,-2,109,110}),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS ( 'FACT_ORDER_LINE'[ORDER_LINE_FLG] &amp;lt;&amp;gt; 1 )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Aug 2020 03:43:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1297709#M22418</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2020-08-15T03:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Token Comma Expected Error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1300181#M22497</link>
      <description>You can't write&lt;BR /&gt;'FACT_ORDER_LINE'[ORDER_STATUS_KEY] &amp;lt;&amp;gt; {27,22,20,18,23,19,-2,109,110}&lt;BR /&gt;since the LHS is a scalar and the RHS is a set. When you compare objects they must be of the same type.&lt;BR /&gt;&lt;BR /&gt;The correct condition is&lt;BR /&gt;NOT 'FACT_ORDER_LINE'[ORDER_STATUS_KEY] IN {27,22,20,18,23,19,-2,109,110}</description>
      <pubDate>Mon, 17 Aug 2020 08:24:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Token-Comma-Expected-Error/m-p/1300181#M22497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T08:24:51Z</dc:date>
    </item>
  </channel>
</rss>

