<?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: Why my measure can't be filtered ? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368494#M126724</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="598062" data-lia-user-login="clementalba" class="lia-mention lia-mention-user"&gt;clementalba&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;previous = 
VAR PY =
    SELECTEDVALUE(Clients[InvoiceYear]) - 1
VAR ClientCode = MAX('Clients'[Code])
RETURN
    CALCULATE (
        [Sum of sales],
        FILTER (
            ALL ( Orders ),
            Orders[Client Code] = ClientCode,
            Orders[InvoiceYear] = PY
        )
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 07 Aug 2023 13:42:43 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-08-07T13:42:43Z</dc:date>
    <item>
      <title>Why my measure can't be filtered ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368299#M126711</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a table which contains informations about some orders and I want to display in a visual the sum of the current year sales and the sum of the previous year sales. Classic problem I guess, so I looked on internet and found a lot of topics for this but all were working with dates. However, In my tables the year is stored as an integer (ex: 2023, 2022...). So I built my own measure which works pretty well, I can obtain the annual sales for the year before the one selected in my slicer:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;previous = 
VAR PY =
    SELECTEDVALUE(Clients[InvoiceYear]) - 1
RETURN
    CALCULATE (
        [Sum of sales],
        FILTER (
            ALL ( Orders ),
            Orders[InvoiceYear] = PY
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I want to filter my data on the invoice year of the table Clients.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now I'm facing another problem : this measure can't be filtered. When I want to display it in a table with clients codes (stored in Clients table) for example, the value of the total year sales is displayed in each row and I'm not able to have the year sales by client and I really don't understand why.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did someone can help me please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clément&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 12:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368299#M126711</guid>
      <dc:creator>clementalba</dc:creator>
      <dc:date>2023-08-07T12:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why my measure can't be filtered ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368310#M126713</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;previous = 
VAR PY =
    MAX(Clients[InvoiceYear]) - 1
RETURN
    CALCULATE (
        [Sum of sales],
            REMOVEFILTERS([column with slicer]),
            Orders[InvoiceYear] = PY
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 12:14:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368310#M126713</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-08-07T12:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why my measure can't be filtered ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368494#M126724</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="598062" data-lia-user-login="clementalba" class="lia-mention lia-mention-user"&gt;clementalba&lt;/a&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;previous = 
VAR PY =
    SELECTEDVALUE(Clients[InvoiceYear]) - 1
VAR ClientCode = MAX('Clients'[Code])
RETURN
    CALCULATE (
        [Sum of sales],
        FILTER (
            ALL ( Orders ),
            Orders[Client Code] = ClientCode,
            Orders[InvoiceYear] = PY
        )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Aug 2023 13:42:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3368494#M126724</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-08-07T13:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why my measure can't be filtered ?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3369615#M126777</link>
      <description>&lt;P&gt;Works great, thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434309" data-lia-user-login="eliasayyy" class="lia-mention lia-mention-user"&gt;eliasayyy&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 06:30:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Why-my-measure-can-t-be-filtered/m-p/3369615#M126777</guid>
      <dc:creator>clementalba</dc:creator>
      <dc:date>2023-08-08T06:30:13Z</dc:date>
    </item>
  </channel>
</rss>

