I have database and SSAS with me.
In DB:
1) fact table factSales
:
+-----------------+----------+
| ColumnName | Datatype |
+-----------------+----------+
| JoinDate | date |
| TransactionDate | date |
| Amt | money |
| CustomerId | int |
| ....... |
| ....... |
+-----------------+----------+
2) time dimension table dimDate
+-----------------+----------+
| ColumnName | Datatype |
+-----------------+----------+
| Date | date |
| MonthNumber | date |
| Year | int |
| Week | int |
| ....... |
| ....... |
+-----------------+----------+
In SSAS:
- Measure group
factSales
(with measures: TotalAmt, Sales Count, Customer Distinct Count) - dimension
JoinDate
(based ondimDate
) - dimension
TransactionDate
(based ondimDate
)
I need to add a functionality to achieve:
For example, a user chooses TransactionDate
from 2015-01-01
to 2015-02-01
.
I need to add:
- A new calculate member BaseCustomersAmt, which shows only sales made within [
2015-01-01
--2015-02-01
] period by customers whereJoinDate
is less than [2015-01-01
] i.e. 1 year - A new calculate member NewCustomersAmt, which shows only sales made within [
2015-01-01
--2015-02-01
] period by customers whereJoinDate
is greater than or equal to [2015-01-01
] i.e. 1 year
So, the idea is that I need to split the total sales (TotalAmt
) by two groups -
first group is those who joined more than 1 year ago from chosen period,
second group the rest - who joined on or after a date which is 1 year ago from a chosen period.
Of course, the user can create two separate reports and use different ranges of Join Date, but the requirement is to do it in one report and do it automatically.
Is it possible to achieve? Please help.