Month -> Day Allocation

m1nkeh

New Member
Joined
Jul 28, 2014
Messages
30
Hi,

I am allocating some targets from month level down to day, but i only want to allocate it to Working days... i have the following query, but when the monthly target is actually posted on a non-working day (i.e. 1st Feb 2014) it seems to break.. i.e. nothing is displayed at all..

CALCULATE(
SUMX (
VALUES(Dates[Date]),
CALCULATE (
CALCULATE (
SUM ( SalesTargets[Target] ),
ALL ( Dates[Date] ),
SUMMARIZE ( Dates, Dates[MonthName])
)
/ CALCULATE (
DISTINCTCOUNT ( Dates[Date] ),
ALL ( Dates[Date] ),
Dates[IsWorkingDay] = 1,
SUMMARIZE ( Dates, Dates[MonthName] )
)
)
)
,Dates[IsWorkingDay]=1
)

i can't figure out why, and without knowing why... i can't fix it :(

thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
A bit hard for me to say on this one... I don't call summarize too often, and the relationship between this month-granular sales target and day-granular date table is an interesting consideration.

Without crazy amount of thinking, I expect I would be doing stuff like...

NumDays:=CALCULATE(COUNTROWS(Dates), Dates[IsWorkingDay] = TRUE)
DailyTarget := SUM(MonthlySalesTargets[Target]) / [NumDays]
TotalTarget := SUMX(Dates, [DailyTarget])
 
Upvote 0
I'll give that one a go, but I think the issue will still be the same whereby I want to only display a measure on days that are non-working days and it's that bit which is falling over...

can upload another workbook ;)
 
Upvote 0
the actual first stumbling block is that the NumDays measure does not consider Month, and therefore just counts a day as itself... that's why you need to 'group by' with the summarize function :(
 
Upvote 0
That mis-match in granularity of dates is, like I said, ... interesting.

hehe, when i sat down to do the calc i actually thought to myself... bah this can't be to hard. I'll take a look at the link, thanks!

i would imagine this grain mis-match probably isn't that uncommon. you would typically issues Sales targets at monthly, or perhaps higher level (quarter?) if you were feeling especially lazy... but want to report across months.

In order to report across months you need to have some value at the day level.
 
Upvote 0

Forum statistics

Threads
1,224,027
Messages
6,175,990
Members
452,693
Latest member
Dethpod1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top