<?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: DAX Filter Problem in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1719944#M35565</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="290433" data-lia-user-login="DDL1976" class="lia-mention lia-mention-user"&gt;DDL1976&lt;/a&gt;&amp;nbsp;The former isn't working due to a mechanism know as "Context Transition", pretty sophisticated thing but you will get a hang of it soon.&lt;/P&gt;
&lt;P&gt;For now write your code like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AC =
VAR CurrentFinancialYear = [CFY]
VAR DateFilter =
    FILTER ( DimPeriod, DimPeriod[Financial Year] = CurrentFinancialYear )
VAR Result =
    CALCULATE ( SUM ( FactTransactionLine[Value] ), DateFilter )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;And once you are comfortable with DAX write it like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AC =
VAR CurrentFinancialYear = [CFY]
VAR Result =
    CALCULATE (
        SUM ( FactTransactionLine[Value] ),
        KEEPFILTERS ( DimPeriod[Financial Year] = CurrentFinancialYear )
    )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Mar 2021 02:38:23 GMT</pubDate>
    <dc:creator>AntrikshSharma</dc:creator>
    <dc:date>2021-03-13T02:38:23Z</dc:date>
    <item>
      <title>DAX Filter Problem</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1719722#M35557</link>
      <description>&lt;P&gt;I am new to the wqorld of DAX and Power BI...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created the following 2 measures but they dont work...&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CFY = LOOKUPVALUE(DimPeriod[Financial Year], DimPeriod[Period End Date], LASTDATE(DimPeriod[Period End Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AC = CALCULATE(SUM(FactTransactionLine[Value]), FILTER(DimPeriod, DimPeriod[Financial Year] = [CFY]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I don't get an error however the result is the same as if there is no filter.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But this measure work perfectly&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AC = CALCULATE(SUM(FactTransactionLine[Value]), FILTER(DimPeriod, DimPeriod[Financial Year] = "2020/21"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have checked that my CFY easure returns&amp;nbsp;2020/21 by adding it to a table visual...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help would be awesome!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Mar 2021 20:57:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1719722#M35557</guid>
      <dc:creator>DDL1976</dc:creator>
      <dc:date>2021-03-12T20:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Filter Problem</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1719944#M35565</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="290433" data-lia-user-login="DDL1976" class="lia-mention lia-mention-user"&gt;DDL1976&lt;/a&gt;&amp;nbsp;The former isn't working due to a mechanism know as "Context Transition", pretty sophisticated thing but you will get a hang of it soon.&lt;/P&gt;
&lt;P&gt;For now write your code like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AC =
VAR CurrentFinancialYear = [CFY]
VAR DateFilter =
    FILTER ( DimPeriod, DimPeriod[Financial Year] = CurrentFinancialYear )
VAR Result =
    CALCULATE ( SUM ( FactTransactionLine[Value] ), DateFilter )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;And once you are comfortable with DAX write it like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AC =
VAR CurrentFinancialYear = [CFY]
VAR Result =
    CALCULATE (
        SUM ( FactTransactionLine[Value] ),
        KEEPFILTERS ( DimPeriod[Financial Year] = CurrentFinancialYear )
    )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 02:38:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1719944#M35565</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2021-03-13T02:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Filter Problem</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1720120#M35571</link>
      <description>&lt;P&gt;Thats amazing thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 09:12:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-Problem/m-p/1720120#M35571</guid>
      <dc:creator>DDL1976</dc:creator>
      <dc:date>2021-03-13T09:12:15Z</dc:date>
    </item>
  </channel>
</rss>

