<?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 Calculate disctinctcount as total and ignore filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030640#M103550</link>
    <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;produced Qty = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[ID]&lt;/SPAN&gt;&lt;SPAN&gt;) , &lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[step]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; || &lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[step]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;which calculates the total amount of &lt;U&gt;produced items&lt;/U&gt;. From this I would like to calculate the percentage of faulty items.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;On process step 1 and 2 it is ok, but the same item goes trough step 3,4,5 etc.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I am filtering on the visual the next process step e.g step 4 i am getting a blank result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I understand why - formula filters ste 1 and 2 from data and visual filter step 4. no result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I want to achieve is to keep the same result on the step 4 ( so ignore all visual filter )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I thing this is the ALL funtion,but I am having trouble to write it down. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PS&amp;gt; I also have different filters like date, item,...in the visual, which I would like to use.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So it should ignore only the process step visual filter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 19 Jan 2023 08:20:38 GMT</pubDate>
    <dc:creator>Tommyvhod</dc:creator>
    <dc:date>2023-01-19T08:20:38Z</dc:date>
    <item>
      <title>Calculate disctinctcount as total and ignore filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030640#M103550</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;produced Qty = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[ID]&lt;/SPAN&gt;&lt;SPAN&gt;) , &lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[step]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; || &lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[step]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;which calculates the total amount of &lt;U&gt;produced items&lt;/U&gt;. From this I would like to calculate the percentage of faulty items.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;On process step 1 and 2 it is ok, but the same item goes trough step 3,4,5 etc.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I am filtering on the visual the next process step e.g step 4 i am getting a blank result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I understand why - formula filters ste 1 and 2 from data and visual filter step 4. no result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I want to achieve is to keep the same result on the step 4 ( so ignore all visual filter )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I thing this is the ALL funtion,but I am having trouble to write it down. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PS&amp;gt; I also have different filters like date, item,...in the visual, which I would like to use.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So it should ignore only the process step visual filter&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Jan 2023 08:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030640#M103550</guid>
      <dc:creator>Tommyvhod</dc:creator>
      <dc:date>2023-01-19T08:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate disctinctcount as total and ignore filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030697#M103555</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178387" data-lia-user-login="Tommyvhod" class="lia-mention lia-mention-user"&gt;Tommyvhod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;produced Qty =
CALCULATE(
    DISTINCTCOUNT(Data[ID]) , 
    KEEPFILTERS(Data[step] = 1 || Data[step] = 2)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Jan 2023 08:39:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030697#M103555</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-01-19T08:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate disctinctcount as total and ignore filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030734#M103561</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;o &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Unfortunately not working. Maybe because the distinctcount is counting ID and we are filtering the process step?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Jan 2023 09:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3030734#M103561</guid>
      <dc:creator>Tommyvhod</dc:creator>
      <dc:date>2023-01-19T09:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate disctinctcount as total and ignore filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3031286#M103590</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178387" data-lia-user-login="Tommyvhod" class="lia-mention lia-mention-user"&gt;Tommyvhod&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what about this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;produced Qty =
VAR _step = SELECTEDVALUE(data[step])
VAR _value1 = 
CALCULATE(
    DISTINCTCOUNT(Data[ID]) ,
    Data[step] = 1 || Data[step] = 2
)
VAR _value2 = 
CALCULATE(
    DISTINCTCOUNT(Data[ID]) ,
    Data[step] =4
)
RETURN
IF( _step = 4, _value2, _value1)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Jan 2023 12:38:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3031286#M103590</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-01-19T12:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate disctinctcount as total and ignore filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3031362#M103593</link>
      <description>&lt;P&gt;If I understood correcly if the process is 4 than the number of parts there will be calculated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem here is that&amp;nbsp; always process 1 and 2 is used for the quantities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like: step 1 and 2 is the production, next steps are other steps like painting, control, packaging ( more than 20 steps) and for defects I would like to return the produced qty. ( step 1+2)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 13:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-disctinctcount-as-total-and-ignore-filter/m-p/3031362#M103593</guid>
      <dc:creator>Tommyvhod</dc:creator>
      <dc:date>2023-01-19T13:06:06Z</dc:date>
    </item>
  </channel>
</rss>

