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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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