<?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: ALL Function doesn't work in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Function-doesn-t-work/m-p/3350013#M125789</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="575098" data-lia-user-login="Jkh30" class="lia-mention lia-mention-user"&gt;Jkh30&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want just filter the Months in your slicer and show all the year.&lt;/P&gt;
&lt;P&gt;For your need , here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)For your need , we can not use the [Date] in the fact table as the slicer , we need to create a dimension date table like this:(this is a calculated table ,we can click "New Table" and enter this to create )&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = ADDCOLUMNS( CALENDAR(DATE(2021,1,1) ,DATE(2023,12,31)) ,"Year" , YEAR([Date]),"Month", FORMAT([Date],"mmmm") , "Month No" ,  MONTH([Date]) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(3)Then we can create a measure like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = var _slicer= VALUES('Date'[Month No])
var _year = MAX('Table'[Year])
var _month = MAX('Table'[Month No])

return
IF( _month in  _slicer , SUM('Table'[Value]),BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4)Then we can put the 'Date'[Date] as the slicer and put the fields on the visual and then we can meet your need:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2023 03:01:55 GMT</pubDate>
    <dc:creator>v-yueyunzh-msft</dc:creator>
    <dc:date>2023-07-26T03:01:55Z</dc:date>
    <item>
      <title>ALL Function doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Function-doesn-t-work/m-p/3346108#M125642</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;Month No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01-Jan-22&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;January&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01-Jan-23&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;January&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01-Feb-22&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;February&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01-Feb-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;February&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And my requirement is to show all the year of the data from date range selection, for example if I choose the date between 01-01-2022 until 28-02-2022. The chart should show two lines, which the January and February of 2022 and 2023. I tried to use ALL to exclude the date but it's still filtering like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Value]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The visual is not showing the data of year 2023. The expected result is to show all the years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be so appreciated. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 08:55:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Function-doesn-t-work/m-p/3346108#M125642</guid>
      <dc:creator>Jkh30</dc:creator>
      <dc:date>2023-07-24T08:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Function doesn't work</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Function-doesn-t-work/m-p/3350013#M125789</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="575098" data-lia-user-login="Jkh30" class="lia-mention lia-mention-user"&gt;Jkh30&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want just filter the Months in your slicer and show all the year.&lt;/P&gt;
&lt;P&gt;For your need , here are the steps you can refer to :&lt;BR /&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)For your need , we can not use the [Date] in the fact table as the slicer , we need to create a dimension date table like this:(this is a calculated table ,we can click "New Table" and enter this to create )&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = ADDCOLUMNS( CALENDAR(DATE(2021,1,1) ,DATE(2023,12,31)) ,"Year" , YEAR([Date]),"Month", FORMAT([Date],"mmmm") , "Month No" ,  MONTH([Date]) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(3)Then we can create a measure like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = var _slicer= VALUES('Date'[Month No])
var _year = MAX('Table'[Year])
var _month = MAX('Table'[Month No])

return
IF( _month in  _slicer , SUM('Table'[Value]),BLANK())&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4)Then we can put the 'Date'[Date] as the slicer and put the fields on the visual and then we can meet your need:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this method does not meet your needs, you can provide us with your special &lt;STRONG&gt;sample data&lt;/STRONG&gt; and the &lt;STRONG&gt;desired output sample&lt;/STRONG&gt; data in the form of &lt;STRONG&gt;tables&lt;/STRONG&gt;, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 03:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Function-doesn-t-work/m-p/3350013#M125789</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-07-26T03:01:55Z</dc:date>
    </item>
  </channel>
</rss>

