<?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: Calculating and counting moths in filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2631722#M77005</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works so far, just needs some little adjustments to be perfect. I am working on it.&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 16:38:50 GMT</pubDate>
    <dc:creator>talex</dc:creator>
    <dc:date>2022-07-11T16:38:50Z</dc:date>
    <item>
      <title>Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2628520#M76790</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I am using a global filter where I can choose the date range to show only key figures within that range on my report. Lets say I select here 01.01.2022-30.06.2022. For one particular key figure I would like to divide it by 6 in this case as we are selecting 6 months and when selecting 01.01.2022-31.12.2022 therefore divide by 12.&lt;/P&gt;&lt;P&gt;How can I count the months from the page filter and use this in my calculation easily ? I am beginner, so should no be very complicated if possible...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 22:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2628520#M76790</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-08T22:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2628579#M76794</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;You could try this approach which may be helpful if you want to see fractions of months, if you starte on 1-15 and ended on 3-23 for example. 365/12 = 30.4&lt;/P&gt;&lt;P&gt;*I am assuming your date table is named"Dates" and is marked as a date table.&lt;/P&gt;&lt;P&gt;Here are the measures:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Start = &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;End = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Dates[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Months in Period = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_NoOfDays&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;INT&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;[End]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;[Start]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPA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t;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_NoOfDays&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;30.42&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&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;This can be adjusted if needed. The format for the final measure is decimal with one decimal palce.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Image below..&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jul 2022 01:02:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2628579#M76794</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-07-09T01:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2631722#M77005</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works so far, just needs some little adjustments to be perfect. I am working on it.&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 16:38:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2631722#M77005</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-11T16:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2641287#M77554</link>
      <description>&lt;P&gt;One more thing gets on my nerves. When I select the dates 01.01.2022 - 31.12.2022 for example, then I don't get those dates as they do not exist in my table. Maybe I have only 25.01.2022 in January and 27.12.2022 in December, therefore I can only selct them and my calculation will not be 12 months, instead something around 11,... I could round now, but this will not work perfectly.&lt;/P&gt;&lt;P&gt;So how can I select 01.01.2022 - 31.12.2022 for instance, even when those values do not really exist (yet).&lt;/P&gt;&lt;P&gt;I just want to see the values beetwen those dates, but still want to be able to select any date I want in the filter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 11:50:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2641287#M77554</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-15T11:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2641288#M77555</link>
      <description>&lt;P&gt;One more thing gets on my nerves. When I select the dates 01.01.2022 - 31.12.2022 for example, then I don't get those dates as they do not exist in my table. Maybe I have only 25.01.2022 in January and 27.12.2022 in December, therefore I can only selct them and my calculation will not be 12 months, instead something around 11,... I could round now, but this will not work perfectly.&lt;/P&gt;&lt;P&gt;So how can I select 01.01.2022 - 31.12.2022 for instance, even when those values do not really exist (yet).&lt;/P&gt;&lt;P&gt;I just want to see the values beetwen those dates, but still want to be able to select any date I want in the filter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 11:51:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2641288#M77555</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-15T11:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642157#M77604</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;This is the measure that is tied to your date table. (Mine is named calendar.)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Months in Period 1 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_start&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Calendar[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_end&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Calendar[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_NoOfDays&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;INT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_end&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;_start&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_NoOfDays&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;30.41&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It calculates no. of months between any two dates selected. Is this what you are looking for? Set format to Decimal , 1 place.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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>Fri, 15 Jul 2022 20:29:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642157#M77604</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-07-15T20:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642545#M77648</link>
      <description>&lt;P&gt;Yes I got that, its almost what I want. I have a booking table and use the field departure date.&lt;/P&gt;&lt;P&gt;The thing is, there are no departures every single day. Therefore I might not have 01.01.2022 or 15.02.2022 or 31.12.2022 in the table. But I still want to be able to select from the beginning of a month to any date I want and then get the results within this range. I also want to calculate the number of months with my selection and not with the first and last date it finds within my selection.&lt;/P&gt;&lt;P&gt;I was also thinking about a seperate date table, but I don't really want to maintan a date table, do I ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So isnt't there a function or a sytem table I can use, so that I do not depend on the entries I have in my table for the filter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 14:33:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642545#M77648</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-16T14:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642666#M77651</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Yes my assumption is you have separate date table which would have a realtionship to your fact table. The measure is being driven off the date table so you can aggregate anything you want between the dates you select, from the separate date table. This Date table should be continuous and be marked as Date table.&lt;/P&gt;&lt;P&gt;If you want to share an example of what you are trying to accomplish, I can check it out for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 20:54:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2642666#M77651</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-07-16T20:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2645181#M77809</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think it works now. I have created a date table with DAX Function CALENDAR and connected it to the fact table and customized the code a little bit, just as you said.&lt;/P&gt;&lt;P&gt;Perfect. Thanks a lot!!!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 14:25:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2645181#M77809</guid>
      <dc:creator>talex</dc:creator>
      <dc:date>2022-07-18T14:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating and counting moths in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2646043#M77850</link>
      <description>&lt;P&gt;That is great! If you feel like it is a solution can you mark it so? Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 00:55:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-and-counting-moths-in-filter/m-p/2646043#M77850</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-07-19T00:55:02Z</dc:date>
    </item>
  </channel>
</rss>

