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
obrient
New Member

Cumulative grand total & percentage of time gone

Hello all.

I have a challenge that I have been struggling to solve for some time now and I am hoping one or more of you may be able to steer me in the right direction.

 

I have simplified things somewhat, but the basic premise is that we have budgets which are rolled up to the monthly level, with the budgeted amounts all loaded against the first of each month. Through the course of the month, our finance team want to be able to see and report on how well we are performing against that budget given how far through the month we are. This is only ever viewed as deep as the monthly level, so no issues here. I calculate the % time gone in each month and apply this to the total monthly budgeted figure - there is the assumption that the monthly budget will be split evenly by working days in that calendar month.

 

The trouble comes when looking at the grand total. The budgeted numbers all sum up nicely, but this is then multiplied by the % of time gone in the year. This results in a number which may not reflect the sum of the monthly budgeted numbers. I post examples below, given this sample data set.

 

DateTypeAmount
01 January 2021Product36686
01 February 2021Product61274
01 March 2021Product52257
01 April 2021Product32823
01 May 2021Product24308
01 June 2021Product13116
01 July 2021Product33770
01 August 2021Product41911
01 September 2021Product16317
01 October 2021Product14428
01 November 2021Product52476
01 December 2021Product58714
01 January 2021Customer12934
01 February 2021Customer33951
01 March 2021Customer24146
01 April 2021Customer20684
01 May 2021Customer32078
01 June 2021Customer47528
01 July 2021Customer17419
01 August 2021Customer38909
01 September 2021Customer57259
01 October 2021Customer37667
01 November 2021Customer18932
01 December 2021Customer62019
01 January 2021Overheads44289
01 February 2021Overheads12181
01 March 2021Overheads55487
01 April 2021Overheads37080
01 May 2021Overheads35556
01 June 2021Overheads63492
01 July 2021Overheads63065
01 August 2021Overheads61488
01 September 2021Overheads39400
01 October 2021Overheads60279
01 November 2021Overheads28180
01 December 2021Overheads56302

 

The dates table contains a flag [Working Day] to indicate whether a day is a weekday or a weekend - we are only interested in weekdays for the purposes of this calculation.

 

% Time Gone =
CALCULATE ( SUM ( [Working Day] ), FILTER ( Dates, Dates[Date] < TODAY () ) )
    / CALCULATE ( SUM ( Dates[Working Day] ) )
Amount To Date =
CALCULATE ( SUM ( Budgets[Amount] ) * [% Time Gone] )

 

obrient_0-1625065097893.png

 

As you can see, the 'Amount to Date' is calculated correctly for each month.

The grand total shows 49% of 1,398,405 = 685,807.82; this should be the sum of 'Amount to Date' by month = 634,227.45.

I understand why this is being calculated in this way, and I understand the concept of HASONEFILTER. My question is how to achieve this assuming that loading the budgets at a daily level is not possible.

 

I have tried the below formula, but this does not work correctly. I believe I know why - because the [% Time Gone] measure is being evaluated at the row level? And it cannot be evaluated where the first of the month lands on a weekend.

Anyway, it hasn't really got me any closer to my desired result.

 

Amount To Date 2 =
SUMX ( Budgets, CALCULATE ( SUM ( Budgets[Amount] ) * [% Time Gone] ) )

obrient_1-1625066473333.png

 

I am thinking it would require me to calculate a table with the budgeted numbers being split by working day before doing a SUMX, but after much trying I am no closer to figuring it out.

 

Any help at all would be much appreciated!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Picture1.png

 

https://www.dropbox.com/s/nmz7680rasn2o13/obrient.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Picture1.png

 

https://www.dropbox.com/s/nmz7680rasn2o13/obrient.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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