<?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 Variable strange behavior in a measure, report only if substract a number in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4009955#M157937</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have a variable in a measure who returns a value only if I put a minus number at its end but nothing otherwise.&lt;BR /&gt;&lt;BR /&gt;I use integer to identify years.&lt;BR /&gt;&lt;BR /&gt;I want to report a trend, minus the year cicled in red.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The formula is the following to be sure to see the entire graphic:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m_CoutCapitauxPropres = 

VAR varPrem = 
CALCULATE(
    MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise]) 
)-1
     
RETURN



CALCULATE(
SUM(tblEntrepriseDonnees[sglCoutCapitauxPropres]),
FILTER(
CalendrierAnnuel,
CalendrierAnnuel[Année fiscale]  &amp;gt; varPrem
), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Should I simply replace -1 for nothing, zéro or +1, everything vanish.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m_CoutCapitauxPropres = 

VAR varPrem = 
CALCULATE(
    MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise]) 
) // Nothing is substracted or added to the evaluation
     &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;What's the logic behind that behavior? How to solve it? The best solution, for me would be to replace -1 for nothing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2024 23:23:10 GMT</pubDate>
    <dc:creator>Pier2</dc:creator>
    <dc:date>2024-06-25T23:23:10Z</dc:date>
    <item>
      <title>Variable strange behavior in a measure, report only if substract a number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4009955#M157937</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have a variable in a measure who returns a value only if I put a minus number at its end but nothing otherwise.&lt;BR /&gt;&lt;BR /&gt;I use integer to identify years.&lt;BR /&gt;&lt;BR /&gt;I want to report a trend, minus the year cicled in red.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The formula is the following to be sure to see the entire graphic:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m_CoutCapitauxPropres = 

VAR varPrem = 
CALCULATE(
    MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise]) 
)-1
     
RETURN



CALCULATE(
SUM(tblEntrepriseDonnees[sglCoutCapitauxPropres]),
FILTER(
CalendrierAnnuel,
CalendrierAnnuel[Année fiscale]  &amp;gt; varPrem
), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Should I simply replace -1 for nothing, zéro or +1, everything vanish.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;m_CoutCapitauxPropres = 

VAR varPrem = 
CALCULATE(
    MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise]) 
) // Nothing is substracted or added to the evaluation
     &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;What's the logic behind that behavior? How to solve it? The best solution, for me would be to replace -1 for nothing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 23:23:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4009955#M157937</guid>
      <dc:creator>Pier2</dc:creator>
      <dc:date>2024-06-25T23:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Variable strange behavior in a measure, report only if substract a number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4010130#M157938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="749887" data-lia-user-login="Pier2" class="lia-mention lia-mention-user"&gt;Pier2&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Could you please take this DAX out and create a measure to see whether it returns a null value?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(
    MIN(tblEntrepriseDonnees[intAnnee]), USERELATIONSHIP(tblEntreprise[KEntreprise],
    tblEntrepriseDonnees[FKEntreprise]) 
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 02:03:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4010130#M157938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-26T02:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Variable strange behavior in a measure, report only if substract a number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4015785#M158261</link>
      <description>&lt;P&gt;Hello Anonymous&lt;/a&gt; ,&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;That formula returns effectively a value, which is the right value in its context, the year 2015. That's something I already verified in different ways.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the RETURN part of my formula, should I change the variable varPrem for an integer (2015, for exemple) it works perfectly. It's like the variable varPrem doen't convey the value to the RETURN.&lt;BR /&gt;&lt;BR /&gt;On the data side, the table looks like this. The year 2015 (the first of the graph) has no ratio calculated and when its the case, I try to get rid of it because that's meaningless. And I starting to believe it is the source of the problem but I don't know why.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;intAnnee (year using integer)&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;sglCoutCapitauxPropres&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;0,04&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;0,05&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;0,00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;0,12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 14:05:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-strange-behavior-in-a-measure-report-only-if-substract/m-p/4015785#M158261</guid>
      <dc:creator>Pier2</dc:creator>
      <dc:date>2024-06-28T14:05:07Z</dc:date>
    </item>
  </channel>
</rss>

