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
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

@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.

@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
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.

Top Solution Authors