Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JeffManley
Frequent Visitor

DAX: new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeekly

Goal is to create a new table derived from our calendar table that shows YearWeek and the BookingsBudgetWeeklyAllocation.

 

The FinanceValues table holds the BookingsBudget for each month; there are two relationships to the calendar table: YearMonth and YearWeek.

 

I'm easily able to figure out the weekly bookings budget per month

Weekly Bookings Budget Measure = 
    [BookingsBudgetMonthly] / 
    (CALCULATE(
        DISTINCTCOUNT('Calendar'[YearWeek])-1,
        USERELATIONSHIP(FinanceValues[YearMonth], Calendar[YearMonth])
    ))

 

 

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.

 

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:

 

BookingsBudgetWeeklyAllocation =
CALCULATE(
[Total Weekly Allocation],
FinanceAccount[Account_level2]="Bookings",
FinanceScenario[Scenario]="Working Budget",
USERELATIONSHIP(FinanceValues[YearMonth],'Calendar'[YearMonth])
) 

 

 

and then into

 

BookingsBudgetWeeklyAllocationByWeekTable =
SUMMARIZE(
CALCULATETABLE(
'Calendar',
USERELATIONSHIP(Calendar[YearMonth], FinanceValues[YearMonth])
),
Calendar[YearWeek],
"BookingsBudgetByWeek", [BookingsBudgetWeeklyAllocation]
) 

 

  

Nothing seems to work. Please help with a solution.

1 REPLY 1
amitchandak
Super User
Super User

@JeffManley , You can create date from both YYYYMM and YYYYWW and use that to join to the calendar table

 

Date month = date(left([YYYYMM],4) , right([YYYYMM],2) ,1)

 

or

 

Date Week=

var _st = date(left([YYYYWW],4) ,1 ,1)

var _stmon = _st  - weekday(_st , 2) -1 //monday of year start

return

_stmon  + right([YYYYWW],2)*7

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.