Forum Discussion
codyraptor
Resolver I
4 years agoGenerate as a variable within a Measure vs Table Help
Hey all, Need help with a more efficient solution. I'm taking 'sales' and spreading them from the sales date by 12months. Meaning..the same sales number is spread evenly across 12months in order t...
AlexisOlson
Super User
4 years agoI'd strongly recommend using a proper date dimension table rather than trying to generate a calendar within a measure.
codyraptor
Resolver I
4 years agoAlexisOlson Thanks. I have a date dimension table based on the sales date. Unfortunately...I don't have the 'spread date' in the underlying data...so there's no 'join' between the generated date in the temp table and the model. I can do that if I stick with the generated table rather than the measure...but trying to make the model more efficient. Are you familiar with how to pass a date filter through a temp table? I have it working for individual selected dates...but not where it'll automatically recognize multiple months
- AlexisOlson4 years ago
Super User
I'm suggesting something along these lines:
SUMX ( FILTER ( DATESBETWEEN ( dimDate[Date], MIN ( 'biplanning Sales_Fcst'[Accounting Month] ), MAX ( 'biplanning Sales_Fcst'[Deferred Date] ) ), DAY ( [Date] ) = 1 ), [Forecast Measure] )