Forum Discussion
Need Help: Forecast Revenue between start and end date excluding non-working days
The Key issue is to see that when WorkDay=0, the Measure for that day is $0.
Would anyone have ideas on how to achieve that?
- parry2k9 years ago
Super User
Can you add another measure called Measure1 and use that in the graph:
Measure1 = if(WorkDays = 0, BLANK(), MEASURE)
- jimplum019 years agoFrequent Visitor
Similar issue with trying to calculate this way:
SUM(Sales[RevenuePerBillingDay])*'Calendar'[WorkDay]
Results in the following error message:
A single value for column 'WorkDay' in table 'Calendar' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
- v-sihou-msft9 years ago
Microsoft Employee
In your scenario, you have created the "BillingDays" and "RevenuePerBillingDay" based on the CalendarDate table. Now you need to limit the Sales table context if the CalendarDate date values is in date range of the Sales row context.
I assume you have Sales table below:
Then you should filter the CalendarDate date values to determine if rows in Sales table need to be included. The formula of the measure should be like below:
Measure = CALCULATE(SUM(Sales[RevenuePerBillingDay]), FILTER(Sales, COUNTROWS( FILTER( VALUES(CalendarDate[Date]), Sales[StartDate]<=CalendarDate[Date] && Sales[EndDate]>=CalendarDate[Date]) )>0 ) )
And if a date appears in multiple date ranges, the corresponding "RevenuePerBillingDay" will aggregate.
Regards,