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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dkalina97
Helper I
Helper I

Allocate Budget by Date and Type

I have watched YouTube videos and checked topics here but I have been struggling with my budget allocation all week and this is the last item I need to finalize my model.

I have linked my Budget Table to my Sales by Type table. I am attempting to use the Budget Allocation measure below per a tutorial, however, because that product type only had sales on 9 days, it is allocating it over 9 days and thus $7,197 per day, not over the number of days in June, which would make the allocation $2,159.10 per day. Issue 2, because there have not been sales by this product type, the 20,108 in MTD sales, should be compared to $41,022.90 (19 days MTD).

dkalina97_0-1687186260279.png

 



Budget Allocation 1 =
VAR DaysinContext = CALCULATE(COUNTROWS(Dates),all(Dates),values(Dates[Date]))
VAR DaysinMonth = CALCULATE(COUNTROWS(Dates), ALL(Dates), VALUES(Dates[YearMonthnumber]))
VAR CurrentMonth = SELECTEDVALUE(Dates[Month Name])
VAR MonthlyBudgetAmount =
CALCULATE([Total Budget Sales],TREATAS(VALUES(Dates[Month Name]), Budget[Month Name]))

Return
If( OR( HASONEVALUE(Dates[Date]),HASONEVALUE(Dates[YearMonthnumber])),
DIVIDE(DaysinContext, DaysinMonth,0) * MonthlyBudgetAmount,
[Total Budget Sales])

 

2 REPLIES 2
dkalina97
Helper I
Helper I

This will not work as there is not an association between the budget table and the dates table. The budget is linked to the sales type.

amitchandak
Super User
Super User

@dkalina97 , Have you tried something like

 

Power BI Distributing/Allocating the Monthly Target(Convert to Daily Target): Measure ( Daily/MTD): https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Monthly-Target-...

 

Make sure date table has all the dates

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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