<?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: Calculate daily budget from monthly budget in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1134407#M16894</link>
    <description>&lt;P&gt;I did the join in SQL, much easier than messing around with this in DAX.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2020 01:20:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-02T01:20:54Z</dc:date>
    <item>
      <title>Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1121455#M16544</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a budget that is monthly and I want to convert that into daily values, simple in SQL but I'm new to DAX.&lt;/P&gt;&lt;P&gt;The ContractBudget table is imported from SQL&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DateDax is a date table generated by DAX. I currently have no relationship between the tables. In SQL I'd join ContractBudget.Date=DateDax.FirstDayOfMonth to get a budget value for every day of the month but PowerBI says that's a many to many, and there be grumpy dragons ahead.&lt;/P&gt;&lt;P&gt;How do I get a budget value for each day where I divide DecimalBudget by Days In Month to arrive at my daily value?&lt;/P&gt;&lt;P&gt;I'd do a merge in Power Query but calculated tables don't show up there. Is that correct?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 06:03:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1121455#M16544</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-27T06:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1121637#M16546</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Date column in your table seems to always have the first day of the month, you can create a calcualted column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calc column =
VAR daysInMonth_ =
    LOOKUPVALUE (
        DateTable[Days In Month],
        DateTable[First Day Of Month], Table1[Date]
    )
RETURN
    DIVIDE ( Table1[DecimalBudget], daysInMonth_ )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 07:34:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1121637#M16546</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-05-27T07:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1122381#M16567</link>
      <description>&lt;P&gt;That gave me the daily budget for each month but what about if I want to build a visual based on days? Where I need a ContractBudget row for each day in the month? Basically a join on ContractBudget[Date]=DateDax[First Day of Month].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially it would be a CROSSJOIN with a Filter but that's terribly inefficient. How do I make use of the common field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 23:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1122381#M16567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-27T23:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1134407#M16894</link>
      <description>&lt;P&gt;I did the join in SQL, much easier than messing around with this in DAX.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 01:20:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1134407#M16894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-02T01:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1152404#M17553</link>
      <description>&lt;P&gt;Hi Nigel,&lt;/P&gt;&lt;P&gt;I have basically the same problem as you, and DAX syntax seems very complicated. Can you share your SQL solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;//Peter&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:49:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1152404#M17553</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-11T08:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate daily budget from monthly budget</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1154100#M17616</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The simplest way is to have a Date table in SQL, just like you'd generate with DAX. You can cover 100 years with ~30K records. This table has at minimum the following columns Date, FirstDayOfMonth, DaysInMonth. You need a budget table with entries for the first of each month.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Date        FirstOfMonth  DaysInMonth
01/01/2020  01/01/2020    31
02/01/2020  01/01/2020    31
03/01/2020  01/01/2020    31
...
01/02/2020  01/02/2020    28
02/02/2020  01/02/2020    28
&lt;/LI-CODE&gt;&lt;P&gt;Join Contract.Month to Date.FirstOfMonth and you'll get an entry for each day in the calendar.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT DateKey.Date, ContractBudget.ContractID, SUM(ContractBudget.DecimalBudget) / DateKey.DaysInMonth AS BudgetAmount
FROM ContractBudget 
INNER JOIN DateKey ON DateKey.FirstDayOfMonth = ContractBudget.Month 
GROUP BY DateKey.Date, DateKey.DaysInMonth, ContractBudget.ContractID&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:27:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-daily-budget-from-monthly-budget/m-p/1154100#M17616</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-12T00:27:06Z</dc:date>
    </item>
  </channel>
</rss>

