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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dakins
Helper II
Helper II

Divide monthly budget into daily

Hello Everyone,

I'd like to divide this montly budget to daily allocation. My budget table is below but by multiple products.

dakins_0-1658798063855.png

I tried the code below but to no avail:

Cal_Budget_Allocation =
VAR DaysInContext = COUNTROWS( 'Dates' )
VAR DaysInMonth = CALCULATE(COUNTROWS( 'Dates' ), All( 'Dates' ), VALUES( 'Dates' [MonthYear]))
VAR MonthlyBudgetAmounts =
    CALCULATE( [Total Budget], TREATAS( VALUES('Dates'[Month]), 'Budget'[MonthName]))

RETURN
IF(OR(HASONEVALUE( 'Dates'[Date]), HASONEVALUE( 'Dates'[MonthYear])),
DIVIDE( DaysInContext, DaysInMonth, 0) * MonthlyBudgetAmounts,
[Total Budget] )

My desired goal is use the date column from my date table to compare daily sales to budget allocation.
 
Thank you

 

 

 

8 REPLIES 8
dakins
Helper II
Helper II

@ryan_mayu Thanks for the reply.

Below is a google link to the sample budget file. My expected output is to have daily sales next to daily allocated budget.

dakins_0-1658801050621.png

 



https://docs.google.com/spreadsheets/d/1jrB28Iiy_QLGkEdbBPwNRbieOoIMnorn/edit?usp=sharing&ouid=11539... 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello @Ashish_Mathur,

I am unable to download the PBI file. Can you send it again?

 

 

Thanks

File attached.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@dakins 

your screenshot is not clear

is this what you want?

Measure = sum('Table'[USBudgetAmount])/day(EOMONTH(max('Table'[Month]),0))

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




My desired output is this. Daily allocation of monthly budget

dakins_0-1658846659877.png

 

 

Thanks

@dakins 

you can try this

budget = maxx(FILTER('Table',year('Table'[Month])=year('date'[Date])&&month('Table'[Month])=month('date'[Date])),'Table'[USBudgetAmount])/day(eomonth('date'[Date],0))

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@dakins 

could you pls provide the sample data (not in the screenshot) and the expected output.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.