<?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: Sales Variation : when the client is created after the selected month, show 0 instead of -100% in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285763#M122146</link>
    <description>&lt;P&gt;this is the visual that i'm using&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2023 10:54:56 GMT</pubDate>
    <dc:creator>Sofinobi</dc:creator>
    <dc:date>2023-06-15T10:54:56Z</dc:date>
    <item>
      <title>Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3282095#M121924</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;please i need your help,&lt;/P&gt;&lt;P&gt;i have a measure to calculate the sales variation by month by Client like this:&lt;/P&gt;&lt;DIV&gt;&lt;EM&gt;Sales Variation = DIVIDE([Sales],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE([Sales],DATEADD(Date[Date],-1,MONTH)),2)-1&lt;BR /&gt;&lt;/EM&gt;all is working great, but i want to show 0 instead of -100% when the client is created after the selected month&amp;nbsp;&lt;BR /&gt;eg : Client created on June, so the variation on may, April and march should be 0 not -100%&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 15:59:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3282095#M121924</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-13T15:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3283789#M122022</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Sales Variation =
VAR Percentage =
    DIVIDE ( [Sales], CALCULATE ( [Sales], DATEADD ( Date[Date], -1, MONTH ) ), 2 )
RETURN
    COALESCE ( Percentage, 1 ) - 1&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 13:30:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3283789#M122022</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-14T13:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3284013#M122044</link>
      <description>&lt;P&gt;thank you so much for your answer, but it replaces all the -100% by 0 even if the first one is correct,&amp;nbsp;&lt;BR /&gt;eg: in case of client is created on january (with sales) and on february he was with no sales, so the variation should stay -100% for february, not 0.&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 14:58:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3284013#M122044</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-14T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3284109#M122052</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Variation =
VAR MaxDate =
    MAX ( 'Date'[Date] )
RETURN
    IF (
        SELECTEDVALUE ( 'Client'[Date created] ) &amp;gt; MaxDate,
        DIVIDE ( [Sales], CALCULATE ( [Sales], DATEADD ( Date[Date], -1, MONTH ) ), 2 ) - 1,
        0
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Jun 2023 15:54:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3284109#M122052</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-14T15:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285460#M122120</link>
      <description>&lt;P&gt;thank you so much for the answer, but the result gives me only 0 or -100%&lt;BR /&gt;in your VAR MaxDate, i think it will return Today&lt;BR /&gt;&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:19:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285460#M122120</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-15T08:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285504#M122123</link>
      <description>&lt;P&gt;Its meant to be used in a visual which has columns from your date table, I would imagine it would be the year month column. MaxDate would then pick up the end of that month.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 08:46:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285504#M122123</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-15T08:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285763#M122146</link>
      <description>&lt;P&gt;this is the visual that i'm using&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 10:54:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285763#M122146</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-15T10:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285790#M122152</link>
      <description>&lt;P&gt;Check the created date for the clients in question. If they were created before the dates you are showing but had no sales then that would explain what you are seeing.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 11:13:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285790#M122152</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-15T11:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285852#M122160</link>
      <description>&lt;P&gt;no, the creation date for this Client is after the dates in the matrix (created in june), that is my problème&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 12:12:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285852#M122160</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-15T12:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285917#M122165</link>
      <description>&lt;P&gt;Does the column in your visual which identifies the client come from the same table which holds the created date? If it doesn't then that could be the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 12:39:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3285917#M122165</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-15T12:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sales Variation : when the client is created after the selected month, show 0 instead of -100%</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3286082#M122174</link>
      <description>&lt;P&gt;the column in my visual comes from my Date table, not from Client table, may be that the problème, i'll check that&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 14:04:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sales-Variation-when-the-client-is-created-after-the-selected/m-p/3286082#M122174</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-06-15T14:04:19Z</dc:date>
    </item>
  </channel>
</rss>

