<?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: add measure to sum distinct product by week.number in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/759489#M3136</link>
    <description>&lt;P&gt;Dear Derek you have right about my knowledge of Dax. I need to start learn:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile I solve my case in those formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;Measure =
CALCULATE (
SUM ( 'Sheet'[Qty] );
ALLEXCEPT (
'Sheet';
'Sheet'[NR_of_week];
'Sheet'[Material (code)]
)
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;R&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 19:06:05 GMT</pubDate>
    <dc:creator>Roberto33</dc:creator>
    <dc:date>2019-08-06T19:06:05Z</dc:date>
    <item>
      <title>add measure to sum distinct product by week.number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/758681#M3108</link>
      <description>&lt;P&gt;Hello, I'm newby in DAX.&amp;nbsp; i need to ask for favour some experts because I dot't get how to sum it.&lt;/P&gt;&lt;P&gt;Thanks in advanced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to sum value from product by weeks&lt;/P&gt;&lt;P&gt;My measure sum all not filtered by&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;Qty total for Product (code) =
CALCULATE(SUM('Sheet'[Qty]);ALLSELECTED('Sheet'[My_date_column]);'Sheet'[Column_with_nr_week])&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How to change this formula to get&amp;nbsp; tab like this.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Product (code) / 15 / 16/ 17 / 18 / 19 / 20 / 21 / 22 / 23&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;aaab&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / 400 / 500 / 200 / 700 / 900 / 1000 / 300 / 2200&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;not like this&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Product (code) / 15 / 16/ 17 / 18 / 19 / 20 / 21 / 22 / 23&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;aaab&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; / 6200&amp;nbsp; / 6200 / 6200 / 6200 / 6200 / 6200 / 6200 /&amp;nbsp;6200 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for example my row data it's look like this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Product (code) / Qty / My_date_column / Column_with_nr_week&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;aaab / 111 / 2019-08-06 / 32&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;aaab / 113 / 2019-08-05 / 32&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Aug 2019 07:49:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/758681#M3108</guid>
      <dc:creator>Roberto33</dc:creator>
      <dc:date>2019-08-06T07:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: add measure to sum distinct product by week.number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/758861#M3112</link>
      <description>&lt;P&gt;Mate, there is a good rule in DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;DO NOT USE A FUNCTION IN YOUR CODE IF YOU DON'T KNOW PRECISELY HOW IT WORKS.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let this statement above sink in. If you don't stick to it, you'll be sorry rather sooner than later. Please, before you start using something in your DAX code read about it. Here's a good source: &lt;A href="http://www.daxguide.com" target="_blank"&gt;www.daxguide.com&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea how ALLSELECTED works? No? That's what I thought.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALLSELECTED is a very complex DAX function that works with something that's called "shadow filter context." To use it correctly you have to know quite a few things. Once again, please read about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your measure should in all likelihood be this:&lt;/P&gt;&lt;PRE&gt;Qty total for Product (code) = SUM( 'Sheet'[Qty] )&lt;/PRE&gt;&lt;P&gt;I'd also urge you to read about the proper dimensional design.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;BR /&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 09:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/758861#M3112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T09:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: add measure to sum distinct product by week.number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/759489#M3136</link>
      <description>&lt;P&gt;Dear Derek you have right about my knowledge of Dax. I need to start learn:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile I solve my case in those formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;Measure =
CALCULATE (
SUM ( 'Sheet'[Qty] );
ALLEXCEPT (
'Sheet';
'Sheet'[NR_of_week];
'Sheet'[Material (code)]
)
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;R&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 19:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/759489#M3136</guid>
      <dc:creator>Roberto33</dc:creator>
      <dc:date>2019-08-06T19:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: add measure to sum distinct product by week.number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/759542#M3139</link>
      <description>OK. Good.&lt;BR /&gt;&lt;BR /&gt;But be careful with ALLEXCEPT: if there is no DIRECT filter on NR_of_week and/or Material (code), it will remove ALL filtering from the EXPANDED version of Sheet (so, not only Sheet but all tables that are in a 1:many relationship with Sheet) and you might end up with something you won't be able to explain.&lt;BR /&gt;&lt;BR /&gt;As long as you KNOW exactly what ALLEXCEPT in CALCULATE does, you're safe. And, of course, you should test.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Tue, 06 Aug 2019 20:06:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/add-measure-to-sum-distinct-product-by-week-number/m-p/759542#M3139</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-06T20:06:22Z</dc:date>
    </item>
  </channel>
</rss>

