<?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 DAX bar is showing a red error, but not showing any reasoning and won't calculate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128349#M163955</link>
    <description>&lt;P&gt;I am trying to create a formula that returns a date after original purchase. After I wrote the formula, the red bar in the DAX field is popping at red only at the very end of the formula (outside the last parenthesis), but doesnt give any indication to why.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be much appreicated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Customer Retention % = 
VAR CurrentMonthAfter = SELECTEDVALUE('Months After'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE('JOD REPORTS'[First Order Date (EOM)])
Return
DIVIDE(
    CALCULATE(
        DISTINCTCOUNT('JOD REPORTS'[Customer Number]),
        FILTER(
            'JOD REPORTS',
            EOMONTH('JOD REPORTS'[Order Date],0) = EOMONTH(CurrentFirstOrderMonth,CurrentMonthAfter)
        )
    ),
    DISTINCTCOUNT('JOD REPORTS'[Customer Number])
)&lt;/PRE&gt;</description>
    <pubDate>Sun, 01 Sep 2024 15:39:19 GMT</pubDate>
    <dc:creator>paxtonmiller</dc:creator>
    <dc:date>2024-09-01T15:39:19Z</dc:date>
    <item>
      <title>DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128349#M163955</link>
      <description>&lt;P&gt;I am trying to create a formula that returns a date after original purchase. After I wrote the formula, the red bar in the DAX field is popping at red only at the very end of the formula (outside the last parenthesis), but doesnt give any indication to why.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be much appreicated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Customer Retention % = 
VAR CurrentMonthAfter = SELECTEDVALUE('Months After'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE('JOD REPORTS'[First Order Date (EOM)])
Return
DIVIDE(
    CALCULATE(
        DISTINCTCOUNT('JOD REPORTS'[Customer Number]),
        FILTER(
            'JOD REPORTS',
            EOMONTH('JOD REPORTS'[Order Date],0) = EOMONTH(CurrentFirstOrderMonth,CurrentMonthAfter)
        )
    ),
    DISTINCTCOUNT('JOD REPORTS'[Customer Number])
)&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Sep 2024 15:39:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128349#M163955</guid>
      <dc:creator>paxtonmiller</dc:creator>
      <dc:date>2024-09-01T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128366#M163956</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;On a first glance the formula seems correct, because of this the problem might be due to invisible character or maybe your selectedvalue is returning blank. To troubleshoot I would recommend testing the formula with fixed values in variables e.g. 1 for currentmonth after and double checking the formula in a text editor like notebook++.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;One other reason could be some wierd cached data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 16:04:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128366#M163956</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2024-09-01T16:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128368#M163957</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="800048" data-lia-user-login="paxtonmiller" class="lia-mention lia-mention-user"&gt;paxtonmiller&lt;/a&gt;&amp;nbsp;To add to&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;I would rewrite it as the following (below). Then you can comment out code and change your RETURN statement to track down what VAR calculation is causing the issue. I suspect it is your numerator.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customer Retention % = 
VAR CurrentMonthAfter = SELECTEDVALUE('Months After'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE('JOD REPORTS'[First Order Date (EOM)])
VAR __Nom = 
    CALCULATE(
        DISTINCTCOUNT('JOD REPORTS'[Customer Number]),
        FILTER(
            'JOD REPORTS',
            EOMONTH('JOD REPORTS'[Order Date],0) = EOMONTH(CurrentFirstOrderMonth,CurrentMonthAfter)
        )
    )
VAR __Denom = DISTINCTCOUNT('JOD REPORTS'[Customer Number])
VAR __Result = DIVIDE( __Nom, Denom )
Return
__Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 16:08:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128368#M163957</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-09-01T16:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128381#M163958</link>
      <description>&lt;P&gt;Greg, This was super helpful, and I think helped isolate. When I submit that formula, it returns saying failed to return "Denom" and that is isnt a table, data, etc.&lt;BR /&gt;&lt;BR /&gt;I do note that there is no __ before the second denom, and I added that, which made the formula work, but didnt return any values.&lt;BR /&gt;&lt;BR /&gt;Appreicate any further tips&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 16:52:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128381#M163958</guid>
      <dc:creator>paxtonmiller</dc:creator>
      <dc:date>2024-09-01T16:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128385#M163959</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="800048" data-lia-user-login="paxtonmiller" class="lia-mention lia-mention-user"&gt;paxtonmiller&lt;/a&gt;&amp;nbsp;Yep, sorry, missed the two underscore characters. So what happens if in your RETURN statement you return __Nom or __Denom instead of __Result? You can also return your first two variables to make sure that those are correct as well. Is it possible that there are multiple values for those so SELECTEDVALUE is returning BLANK?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 17:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128385#M163959</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-09-01T17:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128393#M163960</link>
      <description>&lt;P&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;When I change the calculate to the __nom, it returns all blanks.&lt;BR /&gt;&lt;BR /&gt;When I change it to the __denom, it returns values. I assume that means the issue is coming from the nom. Does that mean there is a portion wrong with this part?&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'JOD REPORTS'&lt;/SPAN&gt;&lt;SPAN&gt;[Customer Number]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'JOD REPORTS'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'JOD REPORTS'&lt;/SPAN&gt;&lt;SPAN&gt;[Order Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;EOMONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CurrentFirstOrderMonth&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;CurrentMonthAfter&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Sep 2024 17:24:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128393#M163960</guid>
      <dc:creator>paxtonmiller</dc:creator>
      <dc:date>2024-09-01T17:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: DAX bar is showing a red error, but not showing any reasoning and won't calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128402#M163961</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="800048" data-lia-user-login="paxtonmiller" class="lia-mention lia-mention-user"&gt;paxtonmiller&lt;/a&gt;&amp;nbsp;Yep, that is where your problem lies most likely. The way it is written, it looks like it is supposed to only return a value when the EOMONTH of the date is equal to the EOMONTH of the selected date and months after. It might be CALCULATE black-boxery going on here. You could try rewriting the measure like this for even more troubleshooting awareness as well as ridding yourself of CALCULATE which tends to trip people up a lot.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customer Retention % = 
VAR CurrentMonthAfter = SELECTEDVALUE('Months After'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE('JOD REPORTS'[First Order Date (EOM)])
VAR __Date = EOMONTH(CurrentFirstOrderMonth,CurrentMonthAfter)
VAR __Table = FILTER( 'JOD REPORTS', EOMONTH('JOD REPORTS'[Order Date],0) = __Date )
VAR __Nom = COUNTROWS( DISTINCT( SELECTCOLUMNS( __Table, "__CustomerNumber", [Customer Number] ) ) ) )
VAR __Denom = DISTINCTCOUNT('JOD REPORTS'[Customer Number])
VAR __Result = DIVIDE( __Nom, __Denom )
Return
__Result&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 01 Sep 2024 17:43:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-bar-is-showing-a-red-error-but-not-showing-any-reasoning-and/m-p/4128402#M163961</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-09-01T17:43:05Z</dc:date>
    </item>
  </channel>
</rss>

