I have monthly budget data that is loaded against a date which is the last date of each month for the next 5 years. For example, the budget for Jan-23 is loaded against 31/01/2023. I would like this value to be divided by the days within that month and then that value is used for each individual day. So if the monthly total loaded against 31/01/2023 is £620k I would want each of the 31 days in Jan to have a value of £20k.
I have seen this question been asked several times on the platform before and I have gone through the various files on allocating budgets and watched the content that is on the platform already but the suggested solutions are not working for the format of my data. The code Sam McKay has shared previously is as below which doesn’t work on my data. I think this is because I have my budgets loaded against a day rather than just ‘January’.
Daily Plan =
VAR DaysinContext = COUNTROWS( Dates )
VAR DaysinMonth = CALCULATE( COUNTROWS( Dates ), ALL( Dates ), VALUES( Dates[Month & Year] ) )
VAR CurrentMonth = SELECTEDVALUE( Dates[MonthName] )
VAR MonthlyBudgetAmounts = CALCULATE( [Total Budgets], FILTER( ALL( ‘Product Budgets’[MonthName] ) , CurrentMonth = ‘Product Budgets’[MonthName] ) )
I have attached the PBIX file and a screenshot of the current plan upload which as you can see if loaded against the last day of the month. Daily Plan.pbix (171.9 KB)
In order to apportion the monthly budgets at a daily level. Firstly, you need to remove the relationship between the Dates and Budgets tables. And create a virtual relationship using the “TREATAS()” function. Below are the steps provided to achieve the results -
Due to inactivity, a response on this post has been tagged as “Solution”.
If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.