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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
joshua1990
Post Prodigy
Post Prodigy

Divide Monthly Budget by working days and accumulate

Hello everyone!

Unfortunately, this is not the first time I am asking for help regarding this challenge.

I have a budget table that has weekly buckets on area level.

The structure is like:

AreaYear-WeekBudget
A2020-011000
A2020-021250
A2020-031500
A2020-041000
B2020-011000
B2020-021750
B2020-031500
B2020-041000

 

This table is linked to my calendar table through year-week key and to the item master through the area key.

So, I can determine which week budget belongs to which fiscal month.

I can also determine which sale on item level belongs to which area.

 

Now, how can I divide the monthly budget by the working days for the corresponding month and to accumulate these daily values?

The result should be like this for month January with working days:

DateBudgetRunning Total
01.01.20237,5237,5
02.01.20237,5475
03.01.20237,5712,5
04.01.20 712,5
05.01.20 712,5
06.01.20237,5950
07.01.20237,51187,5
08.01.20237,51425
09.01.20237,51662,5
10.01.20237,51900
11.01.20 1900
12.01.20 1900
13.01.20237,52137,5
14.01.20237,52375
15.01.20237,52612,5
16.01.20237,52850
17.01.20237,53087,5
18.01.20 3087,5
19.01.20 3087,5
20.01.20237,53325
21.01.20237,53562,5
22.01.20237,53800
23.01.20237,54037,5
24.01.20237,54275
25.01.20 4275
26.01.20 4275
27.01.20237,54512,5
28.01.20237,54750

 

I already have studied this blog:

https://www.daxpatterns.com/budget-patterns/

 

But I can't figure it out.

This is my measure to sum the working days per month

 

Workingdays = 
VAR vSelectedMonth = 
    SELECTEDVALUE ( 'Calendar'[Fiscal Month Number])
RETURN
    CALCULATE ( 
        COUNTROWS ( 'Calendar' ),
        FILTER ( 
            'Calendar',
            'Calendar'[Fiscal Month Number] = vSelectedMonth
              && 'Calendar'[IsWorkingDay] = 1
        )
    )

 

Can someone help?

4 REPLIES 4
amitchandak
Super User
Super User

@joshua1990 , In your calendar you can work day

 

Work day = if(WEEKDAY([Date],2)<6,1,0)

 

Workday of the month = sumx(filter(Date, Date[Month Year] =earlier(Date[Month Year] ),[Work day ])

 

Now when you create allocation using date table you can divide by work days

 

refer if this file can help

https://www.dropbox.com/s/fnq82ksdzk1lqs3/Target_allocation_daily.pbix?dl=0

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thank you so much!

And how can I accumulate these daily targets? Like Running Totals

@joshua1990 , 

Monthly 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

Quarterly 

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))

Yealy = YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

 

Over all. With Date table

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thanks a lot!

Does your approach work with weekly budget as mentioned in the first post?

If so, how?

 

I am using a fiscal calendar with individual start and end dates for every month.

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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