Budget Month-to-date calculation

Hi,

I have a fact table with sales data at line item level, meaning lots of rows with sales orders, revenue etc. per product group pr month. Then I have a budget table with the budgetted revenue pr product group pr month, meaning a lot less detailed. I followed the method at daxpatterns.com/budget-patterns/ with the headline "Complete pattern" to make it work. Now I have a working data model where I can see actual and budget as seperate values.

I then need to calculate the actual revenue month to date and the budgetted revenue month to date. For actual it has worked fine by doing:

=CALCULATE(

sum(Sales[Revenue]);

(DatesMTD(Time[date]))

)

The problem occurs for me doing the same on the budget figure. Since I don't have a budget per day, but only at "YearMonth" level, I have calculated the amount of workdays per month and then used the DatesMTD formula to get the cumulative workdays during the month. Furthermore I calculated the total amount of workdays in the month and made a ratio between this figure and the cumulative workdays so I get a figure in percent that tells me per day how much of the month that has went by (0-100 %). In my mind I would then multiply this percentage with the budget and get the budget month to date. This does not work since my budget figure is not at day level.

Do you have a solution for how I can get it to work. My desired result will be all the dates during a month in my rows and then actual revenue Month to date in values and a corrosponding figure for the budget.

Best regards

Morten

August 19th, 2015 3:18pm

With "budget" table:

Month Budget Days
1 100000 31

and "dates" table:

Date
1/1/2015 12:00:00 AM
1/2/2015 12:00:00 AM
1/3/2015 12:00:00 AM
1/4/2015 12:00:00 AM
1/5/2015 12:00:00 AM
1/6/2015 12:00:00 AM
1/7/2015 12:00:00 AM
1/8/2015 12:00:00 AM
1/9/2015 12:00:00 AM
1/20/2015 12:00:00 AM

In "dates" table, two calculated columns:

Month=FORMAT([Date],"m")

Day=FORMAT([Date],"d")

In "dates" table, two calculated fields:

Ratio:=SUM([Day])/SUM(budget[Days])

BudgetMonthToDate:=SUM(budget[Budget])*[Ratio]

Pivot table or Power View table gives me:

Row Labels BudgetMonthToDate
1/1/2015 3225.806452
1/2/2015 6451.612903
1/3/2015 9677.419355
1/4/2015 12903.22581
1/5/2015 16129.03226
1/6/2015 19354.83871
1/7/2015 22580.64516
1/8/2015 25806.45161
1/9/2015 29032.25806
1/20/2015 64516.12903

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 6:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics