<?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 DAX: new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeekly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-new-table-derived-from-our-calendar-table-that-shows/m-p/3106125#M109475</link>
    <description>&lt;P&gt;Goal is to create a new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeeklyAllocation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FinanceValues table holds the BookingsBudget for each month; there are two relationships to the calendar table: YearMonth and YearWeek.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm easily able to figure out the weekly bookings budget per month&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Weekly Bookings Budget Measure = 
    [BookingsBudgetMonthly] / 
    (CALCULATE(
        DISTINCTCOUNT('Calendar'[YearWeek])-1,
        USERELATIONSHIP(FinanceValues[YearMonth], Calendar[YearMonth])
    ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried many DAX formulas to create a new table showing the Calendar[YearWeek]and the Weekly Bookings Budget divided by the weeks per month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then went another route and created a calculated column [Total Weekly Allocation] in the FinanceValuestable which takes the [Value] column divied by the [WeeksInMonth] the that feeds into:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;BookingsBudgetWeeklyAllocation =
CALCULATE(
[Total Weekly Allocation],
FinanceAccount[Account_level2]="Bookings",
FinanceScenario[Scenario]="Working Budget",
USERELATIONSHIP(FinanceValues[YearMonth],'Calendar'[YearMonth])
) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then into&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;BookingsBudgetWeeklyAllocationByWeekTable =
SUMMARIZE(
CALCULATETABLE(
'Calendar',
USERELATIONSHIP(Calendar[YearMonth], FinanceValues[YearMonth])
),
Calendar[YearWeek],
"BookingsBudgetByWeek", [BookingsBudgetWeeklyAllocation]
) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing seems to work. Please help with a solution.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 15:10:11 GMT</pubDate>
    <dc:creator>JeffManley</dc:creator>
    <dc:date>2023-03-01T15:10:11Z</dc:date>
    <item>
      <title>DAX: new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-new-table-derived-from-our-calendar-table-that-shows/m-p/3106125#M109475</link>
      <description>&lt;P&gt;Goal is to create a new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeeklyAllocation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FinanceValues table holds the BookingsBudget for each month; there are two relationships to the calendar table: YearMonth and YearWeek.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm easily able to figure out the weekly bookings budget per month&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Weekly Bookings Budget Measure = 
    [BookingsBudgetMonthly] / 
    (CALCULATE(
        DISTINCTCOUNT('Calendar'[YearWeek])-1,
        USERELATIONSHIP(FinanceValues[YearMonth], Calendar[YearMonth])
    ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried many DAX formulas to create a new table showing the Calendar[YearWeek]and the Weekly Bookings Budget divided by the weeks per month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then went another route and created a calculated column [Total Weekly Allocation] in the FinanceValuestable which takes the [Value] column divied by the [WeeksInMonth] the that feeds into:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;BookingsBudgetWeeklyAllocation =
CALCULATE(
[Total Weekly Allocation],
FinanceAccount[Account_level2]="Bookings",
FinanceScenario[Scenario]="Working Budget",
USERELATIONSHIP(FinanceValues[YearMonth],'Calendar'[YearMonth])
) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then into&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;BookingsBudgetWeeklyAllocationByWeekTable =
SUMMARIZE(
CALCULATETABLE(
'Calendar',
USERELATIONSHIP(Calendar[YearMonth], FinanceValues[YearMonth])
),
Calendar[YearWeek],
"BookingsBudgetByWeek", [BookingsBudgetWeeklyAllocation]
) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing seems to work. Please help with a solution.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 15:10:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-new-table-derived-from-our-calendar-table-that-shows/m-p/3106125#M109475</guid>
      <dc:creator>JeffManley</dc:creator>
      <dc:date>2023-03-01T15:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeekly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-new-table-derived-from-our-calendar-table-that-shows/m-p/3106969#M109563</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="311063" data-lia-user-login="JeffManley" class="lia-mention lia-mention-user"&gt;JeffManley&lt;/a&gt; , You can create date from both YYYYMM and YYYYWW and use that to join to the calendar table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date month = date(left([YYYYMM],4) , right([YYYYMM],2) ,1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date Week=&lt;/P&gt;
&lt;P&gt;var _st = date(left([YYYYWW],4) ,1 ,1)&lt;/P&gt;
&lt;P&gt;var _stmon = _st&amp;nbsp; - weekday(_st , 2) -1 //monday of year start&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;_stmon&amp;nbsp; + right([YYYYWW],2)*7 &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 02:41:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-new-table-derived-from-our-calendar-table-that-shows/m-p/3106969#M109563</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-03-02T02:41:19Z</dc:date>
    </item>
  </channel>
</rss>

