Here is my favorite technique, which is
1) independent of date dimension.
2) can be used from a secondary data source.
3) applicable in labels, references and annotations.
3) applicable in labels, references and annotations.
It has served me well in a number of designs. Just want to share the techniques here with you.
Then we can create the Last Month/Value/Variance formulas.
The above is for the case without dimension. If there is Date dimension in view, the technique can be based on table calculations. But that is a different topic.
Feel free to download the workbook here.
Here are the main steps for getting them.
Last Date
One may get the last date using Level of Details instead of Set. But then you have to be very careful of date filters.
2.To get the Last Order Date (as a Date type):
2.To get the Last Order Date (as a Date type):
Last Value
Note that this is at the row level or record level. May need aggregation in other calculations. Being able to treat data at row level provides us the greatest flexibility.
Last Variance
To get the Last Variance, we need to create the 2nd Last Date set first.
- To get the 2nd Last Value: If 2nd Last Date Then Sales End
- To get the Last Variance, Sum(Last Value)-Sum(2nd Last Value)
- To get the Last Variance%: Last Variance/Sum(2nd Last Value)
Last Month/Value/Variance
We can apply the same technique to calculate the last Month/Value/Variance for which we need to first create the dimension of custom date in month:Then we can create the Last Month/Value/Variance formulas.
The above is for the case without dimension. If there is Date dimension in view, the technique can be based on table calculations. But that is a different topic.
No comments:
Post a Comment