<?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: Getting unexpected exception with measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996603#M155331</link>
    <description>&lt;P&gt;With this method, i change privacy level for this on all file involved:&lt;BR /&gt;&lt;BR /&gt;Is here?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Still dosent work.&lt;BR /&gt;&lt;BR /&gt;Only works on this way:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 16:40:56 GMT</pubDate>
    <dc:creator>Jean_Ferro</dc:creator>
    <dc:date>2024-06-17T16:40:56Z</dc:date>
    <item>
      <title>Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996208#M155265</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I am creating this measure that works as needed only if I keep the date fixed like DATE(2024, 6, 10), if I try to make the date dynamic using a measure that returns the greatest date chosen by the user in the calendar like this:&lt;/P&gt;&lt;P&gt;maxx(dCalendar,[Date])&lt;/P&gt;&lt;P&gt;I get the error "unexpected exception"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ADDCOLUMNS(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SUMMARIZE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[DTABASE] &amp;lt;= DATE(2024, 6, 10)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[PRODUCT_CODE],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[BRANCH],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"MaxDate", MAX(fStock[DTABASE])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Cost",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MAX(fStock[COST]),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[DTABASE] = [MaxDtaEntradaSaida] &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[PRODUCT_CODE] = EARLIER(fStock[PRODUCT_CODE]) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fStock[BRANCH] = EARLIER(fStock[BRANCH])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Cost]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 13:31:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996208#M155265</guid>
      <dc:creator>Jean_Ferro</dc:creator>
      <dc:date>2024-06-17T13:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996218#M155266</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727783" data-lia-user-login="Jean_Ferro" class="lia-mention lia-mention-user"&gt;Jean_Ferro&lt;/a&gt;&amp;nbsp;What about just MAX('dCalendar'[Date])&lt;/P&gt;
&lt;P&gt;or:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR __Date = MAX('dCalendar'[Date])
VAR __Result = 
SUMX(
ADDCOLUMNS(
SUMMARIZE(
FILTER(
fStock,
fStock[DTABASE] &amp;lt;= __Date
),
fStock[PRODUCT_CODE],
fStock[BRANCH],
"MaxDate", MAX(fStock[DTABASE])
),
"Cost",
CALCULATE(
MAX(fStock[COST]),
FILTER(
fStock,
fStock[DTABASE] = [MaxDtaEntradaSaida] &amp;amp;&amp;amp;
fStock[PRODUCT_CODE] = EARLIER(fStock[PRODUCT_CODE]) &amp;amp;&amp;amp;
fStock[BRANCH] = EARLIER(fStock[BRANCH])
)
)
),
[Cost]
)
RETURN
  __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Jun 2024 13:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996218#M155266</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-17T13:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996297#M155272</link>
      <description>&lt;P&gt;Unfortunately the same unexpected exception error, if I change it to DATE(2024,6,5) for example it works, but I need it to be dynamic.&lt;/P&gt;&lt;P&gt;The measure to return the greatest date seems correct to me:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;GreatestDataStock = &lt;/SPAN&gt;&lt;SPAN&gt;maxx&lt;/SPAN&gt;&lt;SPAN&gt;(dCalendar,[Date])&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;</description>
      <pubDate>Mon, 17 Jun 2024 14:10:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996297#M155272</guid>
      <dc:creator>Jean_Ferro</dc:creator>
      <dc:date>2024-06-17T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996309#M155275</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727783" data-lia-user-login="Jean_Ferro" class="lia-mention lia-mention-user"&gt;Jean_Ferro&lt;/a&gt;&amp;nbsp;Any chance you can post a link to the file? Otherwise it's really hard to understand what is going on here.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:12:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996309#M155275</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-17T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996370#M155293</link>
      <description>&lt;P&gt;I was preparing a file to upload with just the information to reproduce the error but when I tested it on this test file it worked.&lt;/P&gt;&lt;P&gt;In my production development I use two databases communicating by direct query sharing 1 calendar, when I separated the calendars leaving one for each database it worked.&lt;/P&gt;&lt;P&gt;I'm going to use it like this for now, but I would like to find a way to use a calendar for both databases without the error.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:53:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996370#M155293</guid>
      <dc:creator>Jean_Ferro</dc:creator>
      <dc:date>2024-06-17T14:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996419#M155300</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727783" data-lia-user-login="Jean_Ferro" class="lia-mention lia-mention-user"&gt;Jean_Ferro&lt;/a&gt;&amp;nbsp;You may want to play around with privacy level settings then. Depending on those settings, some cross query/source queries aren't allowed.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 15:11:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996419#M155300</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-17T15:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996603#M155331</link>
      <description>&lt;P&gt;With this method, i change privacy level for this on all file involved:&lt;BR /&gt;&lt;BR /&gt;Is here?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Still dosent work.&lt;BR /&gt;&lt;BR /&gt;Only works on this way:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 16:40:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996603#M155331</guid>
      <dc:creator>Jean_Ferro</dc:creator>
      <dc:date>2024-06-17T16:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996624#M155335</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="727783" data-lia-user-login="Jean_Ferro" class="lia-mention lia-mention-user"&gt;Jean_Ferro&lt;/a&gt;&amp;nbsp;Yep, that's what I was referring to. Interesting, let me do some research as maybe there is some kind of formula firewall thing going on here.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 16:58:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996624#M155335</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-06-17T16:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected exception with measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996659#M155342</link>
      <description>&lt;P&gt;I tried this way too and it still doesn't work.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your attention and help, I will continue working in the way it is working, if you have any more ideas I would be very happy if you shared them!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 17:11:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-unexpected-exception-with-measure/m-p/3996659#M155342</guid>
      <dc:creator>Jean_Ferro</dc:creator>
      <dc:date>2024-06-17T17:11:08Z</dc:date>
    </item>
  </channel>
</rss>

