<?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: Convert a monthly budget to weekly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/976266#M11809</link>
    <description>&lt;P&gt;Hmmm, this is not the result i wanted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is wat i get, the budget off every month, in the first week of the month.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 14:38:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-16T14:38:46Z</dc:date>
    <item>
      <title>Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972810#M11657</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At our company we have an sales budget per month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole amount is booked at the first day of the month so for example 1-1-2020.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to convert this to a weekly budget based on amount of working days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i have an week with 5 working days it's no problem for me. I use the following formula: (monthbudget)/(workingdayspermonth)*(workingdaysperweek)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i don't know how my formula must be if i have an weeknumber that's devided over two monts. Then i have to take also the budget of previous our next month and multiply that by the amount of workingdays that are in the previous or next month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody help me?&amp;nbsp;&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 13:56:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972810#M11657</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-13T13:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972943#M11660</link>
      <description>So you say that if you have a week spanning 2 months you want to take one part from one month and the other part from the other?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Fri, 13 Mar 2020 14:22:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972943#M11660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-13T14:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972978#M11662</link>
      <description>&lt;P&gt;Exactly&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 14:25:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/972978#M11662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-13T14:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/973073#M11666</link>
      <description>&lt;LI-CODE lang="markup"&gt;// Calendar (marked as Date table in the model)
// must have weeks that are uniquely identified
// in the whole calendar. It must also have a column
// that says True if a day is a working
// day. Name the column [Working Day].
// Name the column with the unique weeks
// [WeekId] (this column should normally be hidden
// and another should be exposed, like [YearWeek]).
// 
// Say that if you select a unique month (
// [MonthId] should be an int that uniquely determines
// the month but you should expose something like '2020-Jan'
// instead of an int to the end user), then the measure
// [Monthly Budget] gives you the amount for the month.


// This one calculates the number of working days
// in any period selection from Calendar.
[Working Days] =
	calculate(
		countrows( 'Calendar' ),
		keepfilters( 'Calendar'[Working Day] )
	)

// This apportions the monthly budget for any
// periods of time, not only weeks. If you select
// a month, then [Budget] = [Monthly Bugdet]. If
// you select any other period of time, then
// the period will be decomposed into pieces that
// belong to different months and then those will
// be summed up.
[Budget] =
var __datesVisible = values( 'Calendar'[Date] )
var __result =
	sumx(
	
		values( Calendar[MonthId] ),
		
		var __monthlyBudget = [Monthly Budget]
		var __workingDaysPerMonth = [Working Days]
		var __workingDaysPerMonthInSelection =
			calculate(
				[Working Days],
				keepfilters( __datesVisible )
			)
		var __budgetInMonthForSelection =
			divide( 
				__monthlyBudget * __workingDaysPerMonthInSelection,
				__workingDaysPerMonth
			)
		return
			__budgetInMonthForSelection
	)
return
	__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 15:04:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/973073#M11666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-13T15:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/976266#M11809</link>
      <description>&lt;P&gt;Hmmm, this is not the result i wanted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is wat i get, the budget off every month, in the first week of the month.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 14:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/976266#M11809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-16T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/976864#M11829</link>
      <description>&lt;P&gt;OK... I've created the model and the correct measure (a little tweak was needed to make it right). Please have a look at the file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApyQEauTSLtOgYMvniTALc9BlHQs_w?e=g2FmD4" target="_blank"&gt;https://1drv.ms/u/s!ApyQEauTSLtOgYMvniTALc9BlHQs_w?e=g2FmD4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Budget] works correctly with any slicing.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best&lt;BR /&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 23:25:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/976864#M11829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-16T23:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/977448#M11843</link>
      <description>&lt;P&gt;thanks a lot! it works!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 06:54:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/977448#M11843</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-17T06:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/977713#M11852</link>
      <description>Kudos would be welcome, if you don't mind, of course.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Tue, 17 Mar 2020 09:41:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/977713#M11852</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-17T09:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a monthly budget to weekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/2674003#M79836</link>
      <description>&lt;P&gt;Thank you. I have been looking for a solution for weeks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 22:45:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Convert-a-monthly-budget-to-weekly/m-p/2674003#M79836</guid>
      <dc:creator>dakins</dc:creator>
      <dc:date>2022-08-01T22:45:36Z</dc:date>
    </item>
  </channel>
</rss>

