<?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: Struggling with formula: select all rows, excluding date slicers in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2432621#M870283</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;: when moving the slicer dates to 01/04/2022 (both of them) I see ZERO, while I was expecting 40 cancelled?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 12:15:45 GMT</pubDate>
    <dc:creator>Conics</dc:creator>
    <dc:date>2022-04-04T12:15:45Z</dc:date>
    <item>
      <title>Struggling with formula: select all rows, excluding date slicers</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2425032#M868124</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm currently struggling with a formula. so here we go:&lt;/P&gt;&lt;P&gt;This is a photo of my dataset:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Actual excal attached below on the dropbox link.&lt;/P&gt;&lt;P&gt;This means I have an order ORD001 for Art. A with a delivered qty of 5 pcs on line 10 and in the same order a canceled line 20 for 5 pieces of Art. B ordered, but since it has been canceled, none were delivered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate the service level of deliveries:&lt;BR /&gt;ORD001- Art. A: 5 out of 5 delivered on 01/03 would mean 100% on a line level;&lt;BR /&gt;ORD001- ART. B: 0 out of 5 = 0% and&lt;BR /&gt;ORD001-Art. C: 10 out of 10 on 05/03/2022 would be 100% on line level.&lt;BR /&gt;while on total ORDER level, that would be 15 delievred out of 20, so 75%.&lt;BR /&gt;&lt;BR /&gt;I also show another order ORD004 with 20 out of 20 delivered pieces for article B, and 0 out of 40 deliverted for ART. B.&lt;/P&gt;&lt;P&gt;That would mean, for Article A 100% service level, for Article B 0%, for the complete order 20 out of 60 delivered = 33%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now for the tricky part:&lt;/P&gt;&lt;P&gt;We want to use a date slicer (Based on delivery date). This will filter out all rows with that Date, BUT... I really need to take in account the date-less rows as well (where cancellations have been happening).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So when looking back at ORD001:&lt;BR /&gt;My service level on 01/03 would be:&amp;nbsp; total ordered 20pieces, delivered: 5 pieces, service level 5 out of 20 = 25%&lt;BR /&gt;My Service level on 05/03 would be: total ordered 20pieces, delivered:15 pieces, service level 15 out of 20 = 75%.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The issue is now: how do I calulate the total Ordered, in such a way, that IT ONLY counts the QTY canceled for the orders applied in the date filter. In other words, If I select 01/03/2022, it should look for all orders with a delivery on that date, then calculate lines delivered AND Qty Canceled (for these orders only), and summarize these.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/5s0vf1fas2t89uk/Desktop.rar?dl=0" target="_self"&gt;Link to my Dataset and PBIX file&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;In my file you will see that no matter how much I change the date slicer, the Total Canceled remains the same... so there's some error in my calculated "total ordered"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 18:03:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2425032#M868124</guid>
      <dc:creator>Conics</dc:creator>
      <dc:date>2022-03-29T18:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with formula: select all rows, excluding date slicers</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2431623#M870015</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="372843" data-lia-user-login="Conics" class="lia-mention lia-mention-user"&gt;Conics&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need a helper column to tell where the order is when the date is empty.&lt;/P&gt;
&lt;P&gt;Add a new index column in Power Query Editor.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Modify the measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Applied Cancelled Lines = 
VAR _mindate =CALCULATE(MIN('Blad1'[Index]),FILTER('Blad1','Blad1'[Delivery Date]=MIN('Blad1'[Delivery Date])))
VAR _maxdate =CALCULATE(MAX('Blad1'[Index]),FILTER('Blad1','Blad1'[Delivery Date]=MAX('Blad1'[Delivery Date])))
VAR _value =
CALCULATE (
    [QTY ordered],
    FILTER (
        'Blad1',
        Blad1[Cancelled] = "Yes"
            &amp;amp;&amp;amp; ISBLANK ( Blad1[Delivery Date] ) = TRUE()
            &amp;amp;&amp;amp;'Blad1'[Index]&amp;gt;=_mindate
            &amp;amp;&amp;amp;'Blad1'[Index]&amp;lt;=_maxdate
    )
)
RETURN
SWITCH(
    TRUE(),
    _value&amp;lt;&amp;gt;0,_value,0)&lt;/LI-CODE&gt;
&lt;P&gt;Filter index columns can help formulas determine whether they are within or outside of this time period.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The result is 5.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Attach the PBIX file for reference. Hope it helps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team_Gao&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to get your questions answered quickly&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to provide sample data&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 09:41:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2431623#M870015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-01T09:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Struggling with formula: select all rows, excluding date slicers</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2432621#M870283</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;: when moving the slicer dates to 01/04/2022 (both of them) I see ZERO, while I was expecting 40 cancelled?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 12:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Struggling-with-formula-select-all-rows-excluding-date-slicers/m-p/2432621#M870283</guid>
      <dc:creator>Conics</dc:creator>
      <dc:date>2022-04-04T12:15:45Z</dc:date>
    </item>
  </channel>
</rss>

