<?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: 2 measures with 2 distinct years not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889039#M7780</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First check your N-X and X are showing correct values i.e 2018 and 2020.&lt;/P&gt;&lt;P&gt;Second remove all from filter section.&lt;/P&gt;&lt;P&gt;If issue still persist then share your dataset. I will check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Pravin Wattamwar&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2020 11:42:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-03T11:42:01Z</dc:date>
    <item>
      <title>2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/888948#M7778</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a slicer from where I select 2 distinct years, imagine 2018 and 2020 and i want to compare 2 distinct measures, one for the context of 2018 and another one for 2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any one know why isn't this working since there are 2 distinct measures for each context?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 10:40:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/888948#M7778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T10:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889039#M7780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First check your N-X and X are showing correct values i.e 2018 and 2020.&lt;/P&gt;&lt;P&gt;Second remove all from filter section.&lt;/P&gt;&lt;P&gt;If issue still persist then share your dataset. I will check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Pravin Wattamwar&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 11:42:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889039#M7780</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T11:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889053#M7782</link>
      <description>&lt;P&gt;Remove that ALL or else you can add KEEPFILTERS Before "Filter".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For More About KEEPFILTERS -&lt;A href="https://www.sqlbi.com/articles/using-keepfilters-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/using-keepfilters-in-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Pravin Wattamwar&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 11:56:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889053#M7782</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T11:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889172#M7786</link>
      <description>&lt;P&gt;Thank you for your assistance, but doesn't work neither using keepfilters, without ALL, with KEEPFILTERS and FILTER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried all the options and perhaps it's a question of dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to simplify I explain my dataset to you, it's a date table and a a fact table joined by DateasInteger key on one to many both sides relation.&lt;/P&gt;&lt;P&gt;The measure is a distintcount of unique references on the fact table&lt;/P&gt;&lt;P&gt;the filter is based on the date table, but i've tried to filter based on the date column of the fact table and behaviour is the same. PBI is summing all rows from both years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 14:32:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889172#M7786</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T14:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889184#M7788</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to replace your &lt;STRONG&gt;PROD_TAB[DATEVAL].[Year]&lt;/STRONG&gt; to &lt;STRONG&gt;YEAR(PROD_TAB[DATEVAL])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 14:47:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889184#M7788</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2020-01-03T14:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889225#M7789</link>
      <description>&lt;P&gt;Thank you for your suggestion but didn't work either.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 15:22:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889225#M7789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889228#M7790</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it looks like it should be enough to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= CALCULATE(
DISTINCTCOUNT(PROD_TAB[REF]);YEAR(PROD_TAB[DATEVAL])=[Yr_N-x]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or (it depends on your data model)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= CALCULATE(
DISTINCTCOUNT(PROD_TAB[REF]);YEAR(PROD_TAB[DATEVAL])=YEAR([Yr_N-x])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 15:28:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889228#M7790</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2020-01-03T15:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889270#M7793</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doesn't work due to this:&lt;/P&gt;&lt;P&gt;A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 16:18:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889270#M7793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: 2 measures with 2 distinct years not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889327#M7795</link>
      <description>&lt;P&gt;Solved with this suggestion from another Post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Prior Day Invoiced =
VAR PreviousBusinessDay = [Priorbusinessday]
RETURN
    CALCULATE (
        SUM ( 'Sales Ledger Transactions'[Net Sales] ),
        'Sales Ledger Transactions'[Fact Attributes.Source Sale Type Code] = "INVOICED",
        'Sales Ledger Transactions'[Date.Date] = PreviousBusinessDay
    )&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 18:22:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/2-measures-with-2-distinct-years-not-working/m-p/889327#M7795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-03T18:22:53Z</dc:date>
    </item>
  </channel>
</rss>

