Forum Discussion
powerbiAG
3 years agoFrequent Visitor
LTM calculation using different reference dates
Hi All, We have a scenario wherein a corporation has on-boarded other businesses and all the details are available in Subsidiary master table. Sample data below... Org Id Name...
- Anonymous3 years ago
Hi powerbiAG ,
If you want to calculate the last 12 months Sales Value (Historic) data (for each business) based on the "integration month" in the fact table, I think LTM Value Historic for Org Id =1 should be 200+120 instead of 100+200+120. Due to Integration Month for Org Id =1 is 2021/Feb, so last 12 month should be from 2020/Feb to 2021/Jan. So 2020/Jan is not in range.
Try code as below to create a calculated column.
LTM Value Historic = VAR _Last12months = FILTER ( CALENDARAUTO (), [Date] <= EOMONTH ( 'Table'[Integration Month], -1 ) + 1 && [Date] >= EOMONTH ( 'Table'[Integration Month], -13 ) + 1 ) RETURN CALCULATE ( SUM ( 'Sales transaction (historic)'[Value (Historic)] ), FILTER ( 'Sales transaction (historic)', 'Sales transaction (historic)'[Month] IN _Last12months ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
powerbiAG
3 years agoFrequent Visitor
Anonymous any thoughts on the above please...