<?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: Total Calculation based on Total/Day for given Month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2350157#M59619</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159827" data-lia-user-login="troyhimes" class="lia-mention lia-mention-user"&gt;troyhimes&lt;/a&gt; .&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because TotalMTD blog I shared. I need to try with data&lt;/P&gt;</description>
    <pubDate>Mon, 21 Feb 2022 06:36:36 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-02-21T06:36:36Z</dc:date>
    <item>
      <title>Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2349637#M59595</link>
      <description>&lt;P&gt;Can't seem to work this one out....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that has budget amount per day for a given month with a date value in the format month/1/year per Area.&amp;nbsp; Data below is for 'Area 1'&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the per/day rate I'd like to calculate the total budget across any time period broken out by Area.&amp;nbsp; The measure below of course works for a single month across any Area, but understandably as soon as I filter across multiple months it fails.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The correct value should be 16124.58=(503.23 * 31 days in Jan.) + (524.45 * 1 day in Feb).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I accomplish this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 01:12:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2349637#M59595</guid>
      <dc:creator>troyhimes</dc:creator>
      <dc:date>2022-02-21T01:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2349856#M59605</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159827" data-lia-user-login="troyhimes" class="lia-mention lia-mention-user"&gt;troyhimes&lt;/a&gt; , Not very clear &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Distributing/Allocating the Monthly Target(Convert to Daily Target): Measure ( Daily/MTD): &lt;A href="https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Monthly-Target-Convert-to/ba-p/1657798" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Monthly-Target-Convert-to/ba-p/1657798&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Distributing/Allocating the Yearly Target(Convert to Daily Target): &lt;A href="https://community.powerbi.com/t5/Community-Blog/Distributing-Allocating-the-Yearly-Target-Convert-to-Daily/ba-p/1463290" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Distributing-Allocating-the-Yearly-Target-Convert-to-Daily/ba-p/1463290&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 03:01:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2349856#M59605</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-21T03:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2350005#M59617</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;You're right, I wasn't very clear!&amp;nbsp; I forgot to include the "measure below".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I scanned your linked post and will check it out closely in the morning.&amp;nbsp; Prior to the measure above, I've determined the value per day using a technique similar to yours, but maybe the piece that I'm missing in the measure is the 'TotalMTD' for my day count(?)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 05:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2350005#M59617</guid>
      <dc:creator>troyhimes</dc:creator>
      <dc:date>2022-02-21T05:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2350157#M59619</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159827" data-lia-user-login="troyhimes" class="lia-mention lia-mention-user"&gt;troyhimes&lt;/a&gt; .&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;because TotalMTD blog I shared. I need to try with data&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 06:36:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2350157#M59619</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-02-21T06:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2351294#M59697</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/hop101plg09rukb/Total%20Calc%20based%20on%20Total%20per%20Day%20for%20given%20Month.pbix?dl=0" target="_blank" rel="noopener"&gt;PowerBI Question.pbix&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here it is. The measure in question is 'MMP_Tons'.&amp;nbsp; The plan per day for the given month is 'MMP_Tons/Day' and the date I've associated with that plan is always the 1st of the month.&amp;nbsp; For a given time period I want to calculate the planned tons based on the plan per day.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 13:59:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2351294#M59697</guid>
      <dc:creator>troyhimes</dc:creator>
      <dc:date>2022-02-21T13:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2352634#M59784</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159827" data-lia-user-login="troyhimes" class="lia-mention lia-mention-user"&gt;troyhimes&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Here is your file with the solution&amp;nbsp;&lt;A href="https://www.dropbox.com/t/lZdUKnpNp5E6wAXA" target="_blank"&gt;https://www.dropbox.com/t/lZdUKnpNp5E6wAXA&lt;/A&gt;&lt;BR /&gt;It is actually simple. you just need to iterate over the table with right granularity which is in this case, the 'Calendar' table&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;MMP_Tons = 
VAR SumMMPTonDay =
    SUM (Actuals_and_MonthlyPlans[MMP_Tons/Day] )
VAR Result =
    SUMX (
        'Calendar',
        SumMMPTonDay 
    ) 
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;Please let me know if this answers you query. Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 07:05:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2352634#M59784</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-22T07:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2353651#M59845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for your attempt, but it looks like this yields the same result as my original measure....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Date Filter=1/1/22 to 1/31/22, MMP_Tons/Day = 503.23, MMP_Tons = 15,600.01 (503.23 *31) &lt;FONT color="#00FF00"&gt;CORRECT&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;2. Date Filter=2/1/22 to 2/28/22, MMP_Tons/Day = 524.45, MMP_Tons = 14,684.59 (524.45 * 28) &lt;FONT color="#00FF00"&gt;CORRECT&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. Date Filter = 1/1/22 to 2/1/22, MMP_Tons = 32,885.62 (1027.68 * 32) &lt;FONT color="#FF0000"&gt;INCORRECT&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;CORRECT VALUE&lt;/STRONG&gt; = 16,124.58 = (503.23 * 31) + (524.45 * 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:37:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2353651#M59845</guid>
      <dc:creator>troyhimes</dc:creator>
      <dc:date>2022-02-22T14:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2354802#M59913</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159827" data-lia-user-login="troyhimes" class="lia-mention lia-mention-user"&gt;troyhimes&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I Plead guilty &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;You are absolutely right. I overlooked the data and did not pay enough attention. I did not notice that the Tons/Day values are only in the first day while in other days are blank which is actually your original problem.&amp;nbsp;&lt;BR /&gt;Please refer to updated file with the solution&amp;nbsp;&lt;A href="https://www.dropbox.com/t/RYcaBXfL2RcdQd5S" target="_blank"&gt;https://www.dropbox.com/t/RYcaBXfL2RcdQd5S&lt;/A&gt;&lt;BR /&gt;The code is little long. I know it can be shorter and more simple by using GENERATE function but I personally still did not learn how to use it properly. Also can be solved by adding a new calculated column. Pretty sure other methods are available out there. However this one seems to work&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;MMP_Tons = 
VAR Table1 = 
    SUMMARIZE (
        Actuals_and_MonthlyPlans,
        Actuals_and_MonthlyPlans[Area],
        'Calendar'[YYMM],
        "@Tons", SUM ( Actuals_and_MonthlyPlans[MMP_Tons/Day])
    )
VAR Table2 =
    SELECTCOLUMNS ( 
        Table1,
        "@YYMM", 'Calendar'[YYMM],
        "@@Tons", [@Tons]
    )
VAR Table3 =
    CROSSJOIN ( 'Calendar', Table2 )
VAR Table4 =
    FILTER ( Table3, [YYMM] = [@YYMM] )
VAR Result =
    SUMX ( Table4, [@@Tons] ) 
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if this solves your problem. Have a nice day!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 04:42:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2354802#M59913</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-02-23T04:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Total Calculation based on Total/Day for given Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2362379#M60419</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, much appreciated, that did the trick.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 16:48:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-Calculation-based-on-Total-Day-for-given-Month/m-p/2362379#M60419</guid>
      <dc:creator>troyhimes</dc:creator>
      <dc:date>2022-02-26T16:48:18Z</dc:date>
    </item>
  </channel>
</rss>

