Forum Discussion
Time Intelligence YTD Based on a Measure
I have what should be a very simple problem that has been very challenging to overcome. I suspect I am complicating it!
I am trying to show the depreciation curve as assets reach the residual value alongside the potential holding cost, the curve is an easy task to accomplish, the issue I am having is that I want to aggregate the total depreciation each month so that I can see the impact of holding certain assets longer vs selling now.
The measure that I am using to calulate the curve is here.
Sum_Depr_Calc_End_Date = CALCULATE(SUM(tbl_OnOffRentStatusRO[MonthlyDepr]),FILTER(ALLSELECTED(tbl_OnOffRentStatusRO), (tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date] >=MAX(tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date]))))
How do I take the result of each period and add it to the previous period? Also I noticed that when I drill up the data is not summed correctly. For instance is the depreciation for each month is 500k for a year then the total depreciation for the year should be 500k * 12. see pictures below.
One thing that stands out immediately in the formula
You need to get (filter) allselected dates up to the current date you are on...
Sum_Depr_Calc_End_Date = CALCULATE ( SUM ( tbl_OnOffRentStatusRO[MonthlyDepr] ), FILTER ( ALLSELECTED ( tbl_OnOffRentStatusRO ), tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date] <= MAX ( tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date] ) ) )Good Luck! :smileyhappy:
2 Replies
- SeanCommunity Champion
One thing that stands out immediately in the formula
You need to get (filter) allselected dates up to the current date you are on...
Sum_Depr_Calc_End_Date = CALCULATE ( SUM ( tbl_OnOffRentStatusRO[MonthlyDepr] ), FILTER ( ALLSELECTED ( tbl_OnOffRentStatusRO ), tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date] <= MAX ( tbl_OnOffRentStatusRO[Deprecation_End_Date].[Date] ) ) )Good Luck! :smileyhappy:
- MattAllingtonCommunity Champion
Here are a couple of articles you may find helpful
http://exceleratorbi.com.au/dax-time-intelligence-beginners/
http://exceleratorbi.com.au/best-practices-power-pivot-power-query-power-bi/