0
votes

I am working on cube in SSAS 2012. I have fact table with items and time dimension. I need to count day average for time chosen in time dimension, how can I do that? I am pretty new in MDX, so any help will be appreciated.

1
What exectly do you want to count?Frank Goortani
As I said, I have items in fact table and I want to count per day average of their count (so for a month, it will be day average items count for a month, for a week it will be day average item count for a week). If I have this day counts for a week - 1,2,3,4,5,6,7, I want to have 4 for a week (28/7) and 0,9 (28/30) for a month (if other weeks are empty).xxviktor

1 Answers

0
votes

If I understand you correctly, you want to have the average count per selected time period. The best way to implement that would be to add a measure "Day Count". You would add a measure group based on the date dimension. Assuming you have all dates in that dimension, and day is the granularity, it could just be a count. Then define a calculated measure which divides your count measure by "Day Count".

Probably, you would want to make the "Day Count" measure invisible after checking that everything works fine.