<?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: Count of days with losses in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960292#M98538</link>
    <description>&lt;P&gt;Hi FreemanZ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue, with a calculation, I have more "days lost" than 30 which should be the maximum. Could it be that there is also a customer-level loss? Can we narrow it down to loss on Material ID?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the below result...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Dec 2022 12:19:14 GMT</pubDate>
    <dc:creator>Sefino535</dc:creator>
    <dc:date>2022-12-10T12:19:14Z</dc:date>
    <item>
      <title>Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2959909#M98510</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me to write a formula that tells me how many days I have lost on the individual products in the past 30 days. The formula should identify today's day -30 so it will be automatically rolling that past.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data contain a day calendar and the days without losses are 0 (zero) and lost is a number per day.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID_ Prod&lt;/TD&gt;&lt;TD&gt;Loss in the past 30 days&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Prod 1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Prod 2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Prod 3&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Prod 4&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Prod 5&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you got any further questions feel free to ask.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 21:43:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2959909#M98510</guid>
      <dc:creator>Sefino535</dc:creator>
      <dc:date>2022-12-09T21:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960008#M98516</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="192197" data-lia-user-login="Sefino535" class="lia-mention lia-mention-user"&gt;Sefino535&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to create a measure with this:&lt;/P&gt;&lt;DIV&gt;DaysLost =&lt;/DIV&gt;&lt;DIV&gt;CALCULATE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; COUNTROWS(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableName,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TableName[Loss]&amp;lt;&amp;gt;0&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; DATESINPERIOD(Calendar[Date],&amp;nbsp;TODAY(), -30, DAY)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 23:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960008#M98516</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-12-09T23:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960292#M98538</link>
      <description>&lt;P&gt;Hi FreemanZ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue, with a calculation, I have more "days lost" than 30 which should be the maximum. Could it be that there is also a customer-level loss? Can we narrow it down to loss on Material ID?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the below result...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 12:19:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960292#M98538</guid>
      <dc:creator>Sefino535</dc:creator>
      <dc:date>2022-12-10T12:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960333#M98539</link>
      <description>&lt;P&gt;the issue of "more "days lost" than 30" depends on your data model, it is possible when there were multiple records/rows per day.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we narrow it down to loss on Material ID? That also depends on your model. The measure itself has nothing to do with&amp;nbsp;Material ID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A piece of advice:&lt;/P&gt;&lt;P&gt;when testing new measures, try with simple setup first, like a table visual with one field plus the measure only.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 13:58:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960333#M98539</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-12-10T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960466#M98560</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;...well is possible that model has more rows per day as a loss. Any Idea how to overcome this this so it will count all losses in a day as "one day" ?&amp;nbsp;&lt;BR /&gt;Anyone help appreciate!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Dec 2022 18:16:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960466#M98560</guid>
      <dc:creator>Sefino535</dc:creator>
      <dc:date>2022-12-10T18:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960978#M98614</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Any suggestion for this problem? I looked up anywhere and I can't get It to work it! Still get more losses than up 30 days, caused by different types of loss = multiple rows counts.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;I wish to count any loss of a day as one day lost out of the past 30 days.&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;I hope it make sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2022 20:42:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2960978#M98614</guid>
      <dc:creator>Sefino535</dc:creator>
      <dc:date>2022-12-11T20:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2961768#M98685</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please try writing a measure something like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DayLost Measure: =
CALCULATE (
    COUNTROWS ( FILTER ( DISTINCT ( 'Calendar'[Date] ), [Losses] &amp;lt;&amp;gt; 0 ) ),
    DATESINPERIOD ( 'Calendar'[Date], TODAY (), -30, DAY )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Dec 2022 08:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2961768#M98685</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-12-12T08:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count of days with losses</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2962252#M98717</link>
      <description>&lt;P&gt;Thanks Jihwan_Kim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works perfectly as expected! The formula does not count single rows, but days of losses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many help you are top!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 10:51:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-of-days-with-losses/m-p/2962252#M98717</guid>
      <dc:creator>Sefino535</dc:creator>
      <dc:date>2022-12-12T10:51:10Z</dc:date>
    </item>
  </channel>
</rss>

