Forum Discussion

mb0307's avatar
mb0307
Icon for Responsive Resident rankResponsive Resident
5 years ago
Solved

Weekly Budget Allocation

Hi,

 

I have Budget table, date table , sales table ,company table

 

Company table just got records UK and US and it is mapped with Budget table and Sales table. 

 

I want to show Weekly budget. Can you please help me to calculate it. On page If i filter company, then it should show only filtered company buget per week. There will be Month and year filter. 

 

Currently I am calculating 

TotalBudgets=CALCULATE(SUM('Budget[mONTHLYbUDGET]),TREATAS(VALUES(Dates[MonthYear]),'Budget'[MonthYear]))

 

I am calculating BudgetPerDay =

var BudgetperMonth =CALCULATE([TOTAL BUDGET],FILTER(Dates,Month(dates[Date])=Month(Max(Dates[Date]))),FILTERS(Company[Company]))
RETURN

9ISFILTERED(Dates[Date]),
DIVIDE(BudgetPerDay,[WorkingDaysinMonth],0),[TotalBudget])

 

Budget table structure and value example.

 

CompanyProductMonthYearMonthly BudgetPerDay BudgetWorking daysDate
UKA101 20215000227.272201/01/2021
USA101 20217000318.182201/01/2021
UKA201 20214000181.812201/01/2021
UKA302 20217000318.182001/02/2021
USA302 20217000318.182001/02/2021
UKA402 20218000

400

2001/02/2021