<?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: using calculate function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/893076#M7935</link>
    <description>I think I see your point what you are trying to achieve but the logic is very incomplete. What if an item is returned mid year? Then it is counted as inventory in that year, but if it is returned on 31-12, it isn't? Where is that border, what if it is rented till 30-12? Why is there a line for available for Mango but not for the others?&lt;BR /&gt;My tip for you is: reconsider your datamodel and logic you want to apply, as this will become messy quickly.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Jan 2020 07:15:42 GMT</pubDate>
    <dc:creator>JarroVGIT</dc:creator>
    <dc:date>2020-01-08T07:15:42Z</dc:date>
    <item>
      <title>using calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892187#M7901</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im new to power BI and i am having issue creating a DAX formula to achieve the result below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;Remark&lt;/TD&gt;&lt;TD&gt;From Date&lt;/TD&gt;&lt;TD&gt;End Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;TD&gt;London&lt;/TD&gt;&lt;TD&g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/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1235&lt;/TD&gt;&lt;TD&gt;Mango&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1236&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Pear&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1237&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Orange&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Relationship&lt;/STRONG&gt;: Table1 &lt;STRONG&gt;*:1&lt;/STRONG&gt; Table2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I would like to create a measure that shows the amount of fruits available within a particular period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ie&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Item&lt;/TD&gt;&lt;TD&gt;2019&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;7(-1) =&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;+1&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mango&lt;/TD&gt;&lt;TD&gt;9(-1) = &lt;STRONG&gt;8&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;8(+1) =&lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;-1&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pear&lt;/TD&gt;&lt;TD&gt;8(-1) =&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;+1&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;orange&lt;/TD&gt;&lt;TD&gt;6(-1)= &lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected Result:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I intend to have the sum of all Item available on my Y axis and the Year on the X axis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you as i anticipate your suggestions and responses&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 15:40:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892187#M7901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-07T15:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: using calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892538#M7914</link>
      <description>&lt;P&gt;I really can't follow your logic. Why is Apple in 2020 7-1=6?&amp;nbsp; And ID in Table 1 is the same ID in table 2? What do the end dates say? And start dates? In other words: please explain your tables a bit, this seems like a very rare datamodel to be honest.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Djerro123&lt;/P&gt;&lt;P&gt;-------------------------------&lt;/P&gt;&lt;P&gt;If this answered your question, please &lt;STRONG&gt;mark it as the Solution&lt;/STRONG&gt;. This also helps others to find what they are looking for.&lt;/P&gt;&lt;P&gt;Keep those &lt;STRONG&gt;thumbs up&lt;/STRONG&gt; coming! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:16:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892538#M7914</guid>
      <dc:creator>JarroVGIT</dc:creator>
      <dc:date>2020-01-07T20:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: using calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892759#M7921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="137611" data-lia-user-login="JarroVGIT" class="lia-mention lia-mention-user"&gt;JarroVGIT&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;I can imagine that the logic is a bit complex. However, to answer your questions&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q1:&amp;nbsp;Why is Apple in 2020 7-1=6?&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Apple in 2020 is 7 -1 = 6 because from the inventory (table 2), the total amount of apples are 7 and in 2020 and apple is rented out from &lt;SPAN&gt;01-01-20&lt;/SPAN&gt; till &lt;SPAN&gt;01-01-21 (table 1, row 1). The means that the apple with ID 1234 would be reduced by 1 from 01-01-20 i.e "from date"&amp;nbsp;, till the01-01-21 i.e "end date" when it becomes available again.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Remark: &lt;EM&gt;Sold = Rented (when item is rented, 1 is subtracted(-1) from the total qty in the inventory(table 2)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Available&amp;nbsp;(when item is rented, 1 is added (+1) from the total qty in the inventory(table 2)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q2: ID in Table 1 is the same ID in table 2?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes, the ID's are the same. The ID are unique identifiers for the items. the relationship is a many to one relationship.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The whole idea is to create a measure to know the qty of items in the inventory that are available to be rented out everytime(in this case yearly).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lets me know if it is clear now &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="137611" data-lia-user-login="JarroVGIT" class="lia-mention lia-mention-user"&gt;JarroVGIT&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Charlie101&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2020 01:33:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/892759#M7921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-08T01:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: using calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/893076#M7935</link>
      <description>I think I see your point what you are trying to achieve but the logic is very incomplete. What if an item is returned mid year? Then it is counted as inventory in that year, but if it is returned on 31-12, it isn't? Where is that border, what if it is rented till 30-12? Why is there a line for available for Mango but not for the others?&lt;BR /&gt;My tip for you is: reconsider your datamodel and logic you want to apply, as this will become messy quickly.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jan 2020 07:15:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/893076#M7935</guid>
      <dc:creator>JarroVGIT</dc:creator>
      <dc:date>2020-01-08T07:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: using calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/893293#M7952</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="137611" data-lia-user-login="JarroVGIT" class="lia-mention lia-mention-user"&gt;JarroVGIT&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The from date and the end date in table 1 would be linked to a date table. With the date table, the date can be shown as Day, Months or Year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Available implies that the item has been returned and is available to be rented out for the period between the start date till the end date&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 09:44:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/using-calculate-function/m-p/893293#M7952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-08T09:44:42Z</dc:date>
    </item>
  </channel>
</rss>

