<?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 the rent  per month in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2383943#M856488</link>
    <description>&lt;P&gt;Hi guys I hope you are doing well&lt;/P&gt;&lt;P&gt;Lately I have been working on a small project and now i need to calculate the&amp;nbsp; total sales of the company products&lt;/P&gt;&lt;P&gt;The company can sell or&amp;nbsp; rent products to customers ,In my sales_table&amp;nbsp; I have a column that indicates if the product is rented or been sold(FMD=0(SOLD),FMD=1(RENT)).&lt;/P&gt;&lt;P&gt;If the product been sold then i have no problem,&amp;nbsp; however if the product is rented then the sales going to be&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AMOUNT/ 12 MONTH &amp;lt;the product is going to be rented for 1 year always&amp;gt;&amp;nbsp; In other word let's suppose I have only 1 product rented in my sales table&amp;nbsp; &amp;nbsp;with these values DATE:01/01/2020,Amount=1200$&lt;/P&gt;&lt;P&gt;then my sales going to look something like this:&lt;/P&gt;&lt;P&gt;JANUARY 2020:100$&lt;/P&gt;&lt;P&gt;FEB 2020:100$&lt;/P&gt;&lt;P&gt;MARCH 2020:100$&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;DECEMBER 2020:100$&lt;/P&gt;&lt;P&gt;JANUARY 2021:0$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SINICE my data is so big i made a simple small example&amp;nbsp; of my sales_table and I wil show you exactly what i Need as a result&lt;/P&gt;&lt;P&gt;1)First i m going to slice the date by month(choose a month of&amp;nbsp; the year)&lt;/P&gt;&lt;P&gt;&amp;lt;I already have a date table that contains dates starting from 01/01/2020 to 31/12/2022&amp;gt;&lt;/P&gt;&lt;P&gt;2)my matrix gonna show me the total sales of that month for each of the company centers(company centers are C1/C2.....)&lt;/P&gt;&lt;P&gt;Here is my sales_table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 JANUARY:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 FEB:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 MARCH:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 APRIL:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Slicing date with 2021 FEB:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0(because the rent ended on 31-december-2020(1year))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Slicing date with 2021 MARCH:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I hope you&amp;nbsp; guys understand what I need and I will be very thankfull for your help and thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 19:23:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-09T19:23:58Z</dc:date>
    <item>
      <title>Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2383943#M856488</link>
      <description>&lt;P&gt;Hi guys I hope you are doing well&lt;/P&gt;&lt;P&gt;Lately I have been working on a small project and now i need to calculate the&amp;nbsp; total sales of the company products&lt;/P&gt;&lt;P&gt;The company can sell or&amp;nbsp; rent products to customers ,In my sales_table&amp;nbsp; I have a column that indicates if the product is rented or been sold(FMD=0(SOLD),FMD=1(RENT)).&lt;/P&gt;&lt;P&gt;If the product been sold then i have no problem,&amp;nbsp; however if the product is rented then the sales going to be&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AMOUNT/ 12 MONTH &amp;lt;the product is going to be rented for 1 year always&amp;gt;&amp;nbsp; In other word let's suppose I have only 1 product rented in my sales table&amp;nbsp; &amp;nbsp;with these values DATE:01/01/2020,Amount=1200$&lt;/P&gt;&lt;P&gt;then my sales going to look something like this:&lt;/P&gt;&lt;P&gt;JANUARY 2020:100$&lt;/P&gt;&lt;P&gt;FEB 2020:100$&lt;/P&gt;&lt;P&gt;MARCH 2020:100$&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;DECEMBER 2020:100$&lt;/P&gt;&lt;P&gt;JANUARY 2021:0$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SINICE my data is so big i made a simple small example&amp;nbsp; of my sales_table and I wil show you exactly what i Need as a result&lt;/P&gt;&lt;P&gt;1)First i m going to slice the date by month(choose a month of&amp;nbsp; the year)&lt;/P&gt;&lt;P&gt;&amp;lt;I already have a date table that contains dates starting from 01/01/2020 to 31/12/2022&amp;gt;&lt;/P&gt;&lt;P&gt;2)my matrix gonna show me the total sales of that month for each of the company centers(company centers are C1/C2.....)&lt;/P&gt;&lt;P&gt;Here is my sales_table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 JANUARY:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 FEB:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 MARCH:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Slicing date with 2020 APRIL:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;Slicing date with 2021 FEB:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0(because the rent ended on 31-december-2020(1year))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Slicing date with 2021 MARCH:&lt;/P&gt;&lt;P&gt;RESULT expected:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;Total_sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I hope you&amp;nbsp; guys understand what I need and I will be very thankfull for your help and thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 19:23:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2383943#M856488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T19:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2383997#M856503</link>
      <description>&lt;P&gt;I am a little confused by the way you provided the example but here is a stab at it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming that 1200/12 = 100 not 120 and that 1200 appears on each month for the 12 month period&lt;/P&gt;&lt;P&gt;Calculated column = IF(FMD = 1, Amount)/12, Amount)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can just create a table using the new column!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 17:07:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2383997#M856503</guid>
      <dc:creator>JaromBIDEVatDK</dc:creator>
      <dc:date>2022-03-09T17:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384072#M856532</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming your monthly rent amount should be 100 and not 120 I think this measure will give you what you are looking for.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rent Amount = 
VAR _Start = MIN ( Dates[Date] )
VAR _End = MAX ( Dates[Date] )
VAR _SalesWithMonths = 
   FILTER (
        ADDCOLUMNS (
            ADDCOLUMNS ( Sales, "@EndDate", EOMONTH ( Sales[DATE], 12 ) - 1 ),
            "@Months", DATEDIFF ( MAX ( _Start, Sales[DATE] ), MIN ( _End, [@EndDate] ), MONTH ) + 1
        ),
        Sales[FMD] = 1
            &amp;amp;&amp;amp; Sales[DATE] &amp;lt;= _End
            &amp;amp;&amp;amp; [@EndDate] &amp;gt;= _Start
    )

RETURN
SUMX(
    _SalesWithMonths,
    DIVIDE ( Sales[AMOUNT] , 12 ) * [@Months] 
)&lt;/LI-CODE&gt;
&lt;P&gt;In order for this to work my Dates table is NOT connected to the Sales table.&amp;nbsp; I also wrote a measure for sales.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Amount = 
VAR _Start = MIN ( Dates[Date] )
VAR _End = MAX ( Dates[Date] )
RETURN
CALCULATE( SUM ( Sales[AMOUNT] ), Sales[FMD] = 0 &amp;amp;&amp;amp; Sales[DATE] &amp;gt;= _Start &amp;amp;&amp;amp; Sales[DATE] &amp;lt;= _End)&lt;/LI-CODE&gt;
&lt;P&gt;Then a totaling measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Amount = [Sales Amount] + [Rent Amount]&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I have attached my sample file for you to look at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 17:49:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384072#M856532</guid>
      <dc:creator>jdbuchanan71</dc:creator>
      <dc:date>2022-03-09T17:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384200#M856576</link>
      <description>&lt;P&gt;Oh my god you are amazing thanks for your help ,&lt;/P&gt;&lt;P&gt;yeah the amount per month is 100 sorry i didn't notice it ,it's not 120&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i have a question if I connect the date table with the sales table it will not work so in my project i have to remove that connection link?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 19:13:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384200#M856576</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T19:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384220#M856582</link>
      <description>&lt;P&gt;yeah&amp;nbsp; the amount is 100 I have edited the post sorry for that&amp;nbsp; and thanks for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 19:23:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384220#M856582</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-09T19:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384321#M856621</link>
      <description>&lt;P&gt;You do have to remove the connection or disable it in the measure.&amp;nbsp; If it is linked up and you select say, June 2021, you would only see records from your sales table with a Date in June 2021 which is not what you want I don't think.&amp;nbsp; You would not see any rent amounts from records with a Date in May 2021 for example.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 21:02:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2384321#M856621</guid>
      <dc:creator>jdbuchanan71</dc:creator>
      <dc:date>2022-03-09T21:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the rent  per month</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2385788#M856994</link>
      <description>&lt;P&gt;yeah that's exactly what happen then I will remove the link in the measure because i need the link for other type of calculation thanks for your time you helped me alot I have already considered your&amp;nbsp; reply as solutions and thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:14:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Calculate-the-rent-per-month/m-p/2385788#M856994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-10T10:14:09Z</dc:date>
    </item>
  </channel>
</rss>

