<?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: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3914247#M152386</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;DISTINCT, VALUES, ALL &amp;amp; ALLSELECTED all of them returns a distinct list of values - or rows if you wrap them around a mulitcolumn table -&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 13:58:22 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2024-05-13T13:58:22Z</dc:date>
    <item>
      <title>Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902399#M152060</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Hey everyone,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I have come across a bottleneck and hope that I could obtain some suggestions here&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I have a table containing a column showing cummulated sum of cost from each country in each month. I would like to, then, create a bar chart controlled by slicer, with:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;Data in this column (cummulated sum value from each country in each month) as y-axis value&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;Month as x-axis value&lt;BR /&gt;Country as the value in slicer&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Meanwhile, I wish to fulfill such functions with the inserted slicer:&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;When &lt;STRONG&gt;specific country&lt;/STRONG&gt; is chosen,&amp;nbsp; the chart shows the&amp;nbsp;cummulated sum of cost from &lt;STRONG&gt;this specific country&lt;/STRONG&gt; in each month ;&amp;nbsp; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;When &lt;STRONG&gt;no country&lt;/STRONG&gt; is chosen, the chart shows &lt;STRONG&gt;the sum&lt;/STRONG&gt; of the&amp;nbsp;cummulated sum of cost&lt;STRONG&gt; from all countries&lt;/STRONG&gt; in each month.&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;The following is the DAX Formula that I wrote in order to achieve such goal. PowerBI detects no synthax error in the formula itself. However, when I put this measure in the visualization field, the y-axis keeps showing the&amp;nbsp;cummulated sum of cost &lt;STRONG&gt;from&lt;/STRONG&gt; &lt;STRONG&gt;each country&lt;/STRONG&gt;, even if no country is chosen in the slicer when it should be showing the&amp;nbsp;cummulated sum of cost &lt;STRONG&gt;from all countries&lt;/STRONG&gt; in each month...It would be greatly appreciated if someone could tell me where my formula goes wrong, or the DAX Formula is not the root cause to this problem in the first place?&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="times new roman,times"&gt;The code I wrote for the measure:&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;Dynamic =&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;IF(ISFILTERED(Table[Country]),&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;CALCULATE(&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(Table[CountryExpCummu.]),&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(Table,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Table[Month] &amp;lt;= EARLIER(Table[Month])&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [CountryExpCummu.]&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="times new roman,times"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 May 2024 13:49:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902399#M152060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-08T13:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902481#M152067</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;That is because 'Table'[Country] is part of the filter context of the visual, therefore it is always filtered.&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Dynamic =
IF (
    COUNTROWS ( ALLSELECTED ( Table[Country] ) ) = 1,
    CALCULATE (
        SUM ( Table[CountryExpCummu.] ),
        FILTER ( Table, Table[Month] &amp;lt;= EARLIER ( Table[Month] ) )
    ),
    [CountryExpCummu.]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 May 2024 14:01:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902481#M152067</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-08T14:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902601#M152072</link>
      <description>&lt;P&gt;You can also use HASONEVALUE dax&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 14:35:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902601#M152072</guid>
      <dc:creator>yyzheng12</dc:creator>
      <dc:date>2024-05-08T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902781#M152080</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="485392" data-lia-user-login="yyzheng12" class="lia-mention lia-mention-user"&gt;yyzheng12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long the column is part if the visual's filter context then it always HASONEVALUE&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 15:42:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3902781#M152080</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-08T15:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3903817#M152108</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to confirm the valuable inputs provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;. Here i have another idea and i would like to share it for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. create measure to calculate cumulative sales for selected country.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE(SUM('financials'[ Sales]),FILTER(ALL('financials'),'financials'[Month Number] &amp;lt;= MAX('financials'[Month Number]) &amp;amp;&amp;amp; 'financials'[Country] = SELECTEDVALUE('financials'[Country])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. create measure to show different results depending on whether the slicer has a selection or not.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 =
VAR _all_sum = CALCULATE(SUM('financials'[ Sales]),FILTER(ALL('financials'),'financials'[Month Number] &amp;lt;= MAX('financials'[Month Number])))
RETURN
IF(ISFILTERED(financials[Country]),'financials'[Measure],_all_sum )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Use MEASURE 2 as the y-axis value.&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;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 02:17:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3903817#M152108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-09T02:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3913472#M152365</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your advice!&amp;nbsp; I would like to, however, ask for your further advice since I am not sure whether COUNTROWS function would work under my situation.&lt;BR /&gt;I forgot to mention that each country has multiple rows that would all show the (same) cummulated cost in each specific month (the reason for that is that there could be multiple costs incurred in each country per month, so when I calculate the sum and then cummulate again those sum numbers in PowerBI without using INDEX to exclude the duplicate number, all the duplicate cummulated data would show)&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:21:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3913472#M152365</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-13T09:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3914247#M152386</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;DISTINCT, VALUES, ALL &amp;amp; ALLSELECTED all of them returns a distinct list of values - or rows if you wrap them around a mulitcolumn table -&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 13:58:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3914247#M152386</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-05-13T13:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Formula DAX:  Sum up the values in a month when nothing is chosen in the slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3914257#M152387</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you so much! I apply your method to my own context and it works perfectly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 14:04:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Formula-DAX-Sum-up-the-values-in-a-month-when-nothing-is-chosen/m-p/3914257#M152387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-13T14:04:18Z</dc:date>
    </item>
  </channel>
</rss>

