<?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 Calculate SUM for single value from multi-select slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2482861#M68038</link>
    <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hey guys,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;hope you can help me out with this one.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I have a filter on month names (for simplicity let's imply the year is always 2022):&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;img /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;And another slicer that allows period selection (MTD/Full).&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'm already calculating the sum over the selected period.&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Now, what I want to achieve is, that it is only calculating the sum&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;STRONG&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;displaying it in a bar chart &lt;SPAN&gt;for the most recent month selected (e.g. March) when the user has MTD selected.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;BR /&gt;I did the calculation like that:&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt; ), &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma, arial, helvetica, sans-serif"&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Dates[Year Month Number]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Dates[Year Month Number]&lt;/SPAN&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;BR /&gt;That works fine and I'm also able to show the whole sum over all months when the user selects "Full" in the other slicer.&lt;BR /&gt;&lt;STRONG&gt;Here is the problem:&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;In a bar chart, Max ( Dates[Year Month Number] ) will always refer to the month the bar shows, so it displays all the selected months instead only the most recent one:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;BR /&gt;How do I achieve that it only shows March now?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 10:11:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-04-28T10:11:14Z</dc:date>
    <item>
      <title>Calculate SUM for single value from multi-select slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2482861#M68038</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hey guys,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;hope you can help me out with this one.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I have a filter on month names (for simplicity let's imply the year is always 2022):&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;img /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;And another slicer that allows period selection (MTD/Full).&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'm already calculating the sum over the selected period.&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Now, what I want to achieve is, that it is only calculating the sum&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;STRONG&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;displaying it in a bar chart &lt;SPAN&gt;for the most recent month selected (e.g. March) when the user has MTD selected.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;BR /&gt;I did the calculation like that:&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt; ), &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma, arial, helvetica, sans-serif"&gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Dates[Year Month Number]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Dates[Year Month Number]&lt;/SPAN&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;BR /&gt;That works fine and I'm also able to show the whole sum over all months when the user selects "Full" in the other slicer.&lt;BR /&gt;&lt;STRONG&gt;Here is the problem:&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;In a bar chart, Max ( Dates[Year Month Number] ) will always refer to the month the bar shows, so it displays all the selected months instead only the most recent one:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;&lt;BR /&gt;How do I achieve that it only shows March now?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 10:11:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2482861#M68038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-28T10:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate SUM for single value from multi-select slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2483003#M68049</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Create a measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;measure =&lt;/P&gt;
&lt;P&gt;var _max = eomonth(maxx(allselected(Dates) , Dates[Date]) ,0)&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate(sum(Table[Value]), filter(Dates, eomonth(Dates[Date],0) =_max)&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 11:00:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2483003#M68049</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-04-28T11:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate SUM for single value from multi-select slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2483391#M68080</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. Solved my issue with the MTD calculation. But I'm not able to transfer your example to a YTD calculation. If a user selects YTD, I want to show all months of the most recent year in a bar chart, despite the fact that the user might have not selected all months. How do I deal with this?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:18:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-SUM-for-single-value-from-multi-select-slicer/m-p/2483391#M68080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-28T13:18:38Z</dc:date>
    </item>
  </channel>
</rss>

